]> Git Repo - linux.git/commitdiff
x86/entry/64: Drop idtentry's manual stack switch for user entries
authorAndy Lutomirski <[email protected]>
Tue, 3 Apr 2018 22:39:26 +0000 (15:39 -0700)
committerIngo Molnar <[email protected]>
Mon, 9 Apr 2018 16:23:50 +0000 (18:23 +0200)
For non-paranoid entries, idtentry knows how to switch from the
kernel stack to the user stack, as does error_entry.  This results
in pointless duplication and code bloat.  Make idtentry stop
thinking about stacks for non-paranoid entries.

This reduces text size by 5377 bytes.

This goes back to the following commit:

  7f2590a110b8 ("x86/entry/64: Use a per-CPU trampoline stack for IDT entries")

Signed-off-by: Andy Lutomirski <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Dominik Brodowski <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Link: http://lkml.kernel.org/r/90aab80c1f906e70742eaa4512e3c9b5e62d59d4.1522794757.git.luto@kernel.org
Signed-off-by: Ingo Molnar <[email protected]>
arch/x86/entry/entry_64.S

index 9b114675fbc05e1f589e6838f4603de871c0565d..e237913a056b9feff933752199b9579847a936c4 100644 (file)
@@ -908,7 +908,7 @@ ENTRY(\sym)
        pushq   $-1                             /* ORIG_RAX: no syscall to restart */
        .endif
 
-       .if \paranoid < 2
+       .if \paranoid == 1
        testb   $3, CS-ORIG_RAX(%rsp)           /* If coming from userspace, switch stacks */
        jnz     .Lfrom_usermode_switch_stack_\@
        .endif
@@ -955,7 +955,7 @@ ENTRY(\sym)
        jmp     error_exit
        .endif
 
-       .if \paranoid < 2
+       .if \paranoid == 1
        /*
         * Entry from userspace.  Switch stacks and treat it
         * as a normal entry.  This means that paranoid handlers
This page took 0.057808 seconds and 4 git commands to generate.