x86/entry/64: Move the switch_to_thread_stack() call to interrupt_entry()
authorDominik Brodowski <[email protected]>
Tue, 20 Feb 2018 21:01:10 +0000 (22:01 +0100)
committerIngo Molnar <[email protected]>
Wed, 21 Feb 2018 15:54:04 +0000 (16:54 +0100)
commit90a6acc4e7ebafa8672a7a1a5b23fbad3dd04130
tree85dc1a1e06ea6a28380fef3d9236d1d674e2485d
parent2ba6474104a1132c4af9f6dc42c6bfe3ca71f8c7
x86/entry/64: Move the switch_to_thread_stack() call to interrupt_entry()

We can also move the CLD, SWAPGS, and the switch_to_thread_stack() call
to the interrupt_entry() helper function. As we do not want call depths
of two, convert switch_to_thread_stack() to a macro.

However, switch_to_thread_stack() has another user in entry_64_compat.S,
which currently expects it to be a function. To keep the code changes
in this patch minimal, create a wrapper function.

The switch to a macro means that there is some binary code duplication
if CONFIG_IA32_EMULATION=y is enabled. Therefore, the size reduction
differs whether CONFIG_IA32_EMULATION is enabled or not:

CONFIG_IA32_EMULATION=y (-0.13k):
   text    data     bss     dec     hex filename
  17158       0       0   17158    4306 entry_64.o-orig
  17028       0       0   17028    4284 entry_64.o

CONFIG_IA32_EMULATION=n (-0.27k):
   text    data     bss     dec     hex filename
  17158       0       0   17158    4306 entry_64.o-orig
  16882       0       0   16882    41f2 entry_64.o

Signed-off-by: Dominik Brodowski <[email protected]>
Acked-by: Thomas Gleixner <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Brian Gerst <[email protected]>
Cc: David Woodhouse <[email protected]>
Cc: Denys Vlasenko <[email protected]>
Cc: H. Peter Anvin <[email protected]>
Cc: Josh Poimboeuf <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: [email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
arch/x86/entry/entry_64.S