Commit 4234653e authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Thomas Gleixner

x86/entry/64: Update comments and sanity tests for create_gap

Commit 2700fefd ("x86_64: Add gap to int3 to allow for call
emulation") forgot to update the comment, do so now.
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Reviewed-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
Acked-by: default avatarAndy Lutomirski <luto@kernel.org>
Cc: bp@alien8.de
Cc: torvalds@linux-foundation.org
Cc: hpa@zytor.com
Cc: dave.hansen@linux.intel.com
Cc: jgross@suse.com
Cc: zhe.he@windriver.com
Cc: joel@joelfernandes.org
Cc: devel@etsukata.com
Link: https://lkml.kernel.org/r/20190711114336.059780563@infradead.org
parent 2fd37912
...@@ -913,15 +913,16 @@ apicinterrupt IRQ_WORK_VECTOR irq_work_interrupt smp_irq_work_interrupt ...@@ -913,15 +913,16 @@ apicinterrupt IRQ_WORK_VECTOR irq_work_interrupt smp_irq_work_interrupt
/** /**
* idtentry - Generate an IDT entry stub * idtentry - Generate an IDT entry stub
* @sym: Name of the generated entry point * @sym: Name of the generated entry point
* @do_sym: C function to be called * @do_sym: C function to be called
* @has_error_code: True if this IDT vector has an error code on the stack * @has_error_code: True if this IDT vector has an error code on the stack
* @paranoid: non-zero means that this vector may be invoked from * @paranoid: non-zero means that this vector may be invoked from
* kernel mode with user GSBASE and/or user CR3. * kernel mode with user GSBASE and/or user CR3.
* 2 is special -- see below. * 2 is special -- see below.
* @shift_ist: Set to an IST index if entries from kernel mode should * @shift_ist: Set to an IST index if entries from kernel mode should
* decrement the IST stack so that nested entries get a * decrement the IST stack so that nested entries get a
* fresh stack. (This is for #DB, which has a nasty habit * fresh stack. (This is for #DB, which has a nasty habit
* of recursing.) * of recursing.)
* @create_gap: create a 6-word stack gap when coming from kernel mode.
* *
* idtentry generates an IDT stub that sets up a usable kernel context, * idtentry generates an IDT stub that sets up a usable kernel context,
* creates struct pt_regs, and calls @do_sym. The stub has the following * creates struct pt_regs, and calls @do_sym. The stub has the following
...@@ -951,10 +952,14 @@ ENTRY(\sym) ...@@ -951,10 +952,14 @@ ENTRY(\sym)
UNWIND_HINT_IRET_REGS offset=\has_error_code*8 UNWIND_HINT_IRET_REGS offset=\has_error_code*8
/* Sanity check */ /* Sanity check */
.if \shift_ist != -1 && \paranoid == 0 .if \shift_ist != -1 && \paranoid != 1
.error "using shift_ist requires paranoid=1" .error "using shift_ist requires paranoid=1"
.endif .endif
.if \create_gap && \paranoid
.error "using create_gap requires paranoid=0"
.endif
ASM_CLAC ASM_CLAC
.if \has_error_code == 0 .if \has_error_code == 0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment