diff options
author | Denys Vlasenko <dvlasenk@redhat.com> | 2015-02-26 17:40:29 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2015-03-04 16:50:50 -0500 |
commit | 0d55083698ed2f498e5682c5c252e6b7224890be (patch) | |
tree | fc378292acdd5370eb2643b73574a76176031860 /arch/x86/kernel/entry_64.S | |
parent | e90e147cbc0cbc8dcf48000e15190badf75250f4 (diff) |
x86/asm/entry/64: Shrink code in 'paranoid_exit'
RESTORE_EXTRA_REGS + RESTORE_C_REGS looks small, but it's
a lot of instructions (fourteen). Let's reuse them.
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
[ Cleaned up the labels. ]
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
Cc: Alexei Starovoitov <ast@plumgrid.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Will Drewry <wad@chromium.org>
Link: http://lkml.kernel.org/r/1421272101-16847-2-git-send-email-dvlasenk@redhat.com
Link: http://lkml.kernel.org/r/59d71848cee3ec9eb48c0252e602efd6bd560e3c.1424989793.git.luto@amacapital.net
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/kernel/entry_64.S')
-rw-r--r-- | arch/x86/kernel/entry_64.S | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S index 695f4d434a84..8fafed9f462d 100644 --- a/arch/x86/kernel/entry_64.S +++ b/arch/x86/kernel/entry_64.S | |||
@@ -1285,15 +1285,13 @@ ENTRY(paranoid_exit) | |||
1285 | DISABLE_INTERRUPTS(CLBR_NONE) | 1285 | DISABLE_INTERRUPTS(CLBR_NONE) |
1286 | TRACE_IRQS_OFF_DEBUG | 1286 | TRACE_IRQS_OFF_DEBUG |
1287 | testl %ebx,%ebx /* swapgs needed? */ | 1287 | testl %ebx,%ebx /* swapgs needed? */ |
1288 | jnz paranoid_restore | 1288 | jnz paranoid_exit_no_swapgs |
1289 | TRACE_IRQS_IRETQ 0 | 1289 | TRACE_IRQS_IRETQ 0 |
1290 | SWAPGS_UNSAFE_STACK | 1290 | SWAPGS_UNSAFE_STACK |
1291 | RESTORE_EXTRA_REGS | 1291 | jmp paranoid_exit_restore |
1292 | RESTORE_C_REGS | 1292 | paranoid_exit_no_swapgs: |
1293 | REMOVE_PT_GPREGS_FROM_STACK 8 | ||
1294 | INTERRUPT_RETURN | ||
1295 | paranoid_restore: | ||
1296 | TRACE_IRQS_IRETQ_DEBUG 0 | 1293 | TRACE_IRQS_IRETQ_DEBUG 0 |
1294 | paranoid_exit_restore: | ||
1297 | RESTORE_EXTRA_REGS | 1295 | RESTORE_EXTRA_REGS |
1298 | RESTORE_C_REGS | 1296 | RESTORE_C_REGS |
1299 | REMOVE_PT_GPREGS_FROM_STACK 8 | 1297 | REMOVE_PT_GPREGS_FROM_STACK 8 |