x86/idt: Fix the X86_TRAP_BP gate

Andrei Vagin reported a CRIU regression and bisected it back to:

90f6225fba0c ("x86/idt: Move IST stack based traps to table init")

This table init conversion loses the system-gate property of X86_TRAP_BP
and erroneously moves it from DPL3 to DPL0.

Fix it.

Reported-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: dvlasenk@redhat.com
Cc: linux-tip-commits@vger.kernel.org
Cc: peterz@infradead.org
Cc: brgerst@gmail.com
Cc: rostedt@goodmis.org
Cc: bp@alien8.de
Cc: luto@kernel.org
Cc: jpoimboe@redhat.com
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: torvalds@linux-foundation.org
Cc: tip-bot for Jacob Shin <tipbot@zytor.com>
Link: http://lkml.kernel.org/r/20170901082630.xvyi5bwk6etmppqc@gmail.com

authored by

Ingo Molnar and committed by
Thomas Gleixner
c6ef8942 5878d5d6

+5 -1
+5 -1
arch/x86/kernel/idt.c
··· 44 44 #define ISTG(_vector, _addr, _ist) \ 45 45 G(_vector, _addr, _ist, GATE_INTERRUPT, DPL0, __KERNEL_CS) 46 46 47 + /* System interrupt gate with interrupt stack */ 48 + #define SISTG(_vector, _addr, _ist) \ 49 + G(_vector, _addr, _ist, GATE_INTERRUPT, DPL3, __KERNEL_CS) 50 + 47 51 /* Task gate */ 48 52 #define TSKG(_vector, _gdt) \ 49 53 G(_vector, NULL, DEFAULT_STACK, GATE_TASK, DPL0, _gdt << 3) ··· 185 181 static const __initdata struct idt_data ist_idts[] = { 186 182 ISTG(X86_TRAP_DB, debug, DEBUG_STACK), 187 183 ISTG(X86_TRAP_NMI, nmi, NMI_STACK), 188 - ISTG(X86_TRAP_BP, int3, DEBUG_STACK), 184 + SISTG(X86_TRAP_BP, int3, DEBUG_STACK), 189 185 ISTG(X86_TRAP_DF, double_fault, DOUBLEFAULT_STACK), 190 186 #ifdef CONFIG_X86_MCE 191 187 ISTG(X86_TRAP_MC, &machine_check, MCE_STACK),