Skip to content

Commit

Permalink
x86/entry/64: Avoid pointless code when CONTEXT_TRACKING=n
Browse files Browse the repository at this point in the history
GAS cannot optimize out the test and conditional jump when context tracking
is disabled and CALL_enter_from_user_mode is an empty macro.

Wrap it in #ifdeffery. Will go away once all this is moved to C.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Alexandre Chartre <alexandre.chartre@oracle.com>
Acked-by: Frederic Weisbecker <frederic@kernel.org>
Acked-by: Andy Lutomirski <luto@kernel.org>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20200505134058.955968069@linutronix.de
  • Loading branch information
Thomas Gleixner committed Jun 11, 2020
1 parent e966039 commit 7250058
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/x86/entry/entry_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -889,12 +889,14 @@ apicinterrupt IRQ_WORK_VECTOR irq_work_interrupt smp_irq_work_interrupt
TRACE_IRQS_OFF
.endif

#ifdef CONFIG_CONTEXT_TRACKING
.if \paranoid == 0
testb $3, CS(%rsp)
jz .Lfrom_kernel_no_context_tracking_\@
CALL_enter_from_user_mode
.Lfrom_kernel_no_context_tracking_\@:
.endif
#endif

movq %rsp, %rdi /* pt_regs pointer */

Expand Down

0 comments on commit 7250058

Please sign in to comment.