Skip to content

Commit 1e4c4f6

Browse files
suryasaimadhuIngo Molnar
authored andcommitted
x86/entry/64: Shorten TEST instructions
Convert TESTL to TESTB and save 3 bytes per callsite. No functionality change. Signed-off-by: Borislav Petkov <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Brian Gerst <[email protected]> Cc: Dave Hansen <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent 3383642 commit 1e4c4f6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/x86/entry/entry_64.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ GLOBAL(retint_user)
620620
GLOBAL(swapgs_restore_regs_and_return_to_usermode)
621621
#ifdef CONFIG_DEBUG_ENTRY
622622
/* Assert that pt_regs indicates user mode. */
623-
testl $3, CS(%rsp)
623+
testb $3, CS(%rsp)
624624
jnz 1f
625625
ud2
626626
1:
@@ -653,7 +653,7 @@ retint_kernel:
653653
GLOBAL(restore_regs_and_return_to_kernel)
654654
#ifdef CONFIG_DEBUG_ENTRY
655655
/* Assert that pt_regs indicates kernel mode. */
656-
testl $3, CS(%rsp)
656+
testb $3, CS(%rsp)
657657
jz 1f
658658
ud2
659659
1:

0 commit comments

Comments
 (0)