Skip to content

Commit 7d28365

Browse files
ubizjakbp3tk0v
authored andcommitted
x86/head_64: Use TESTB instead of TESTL in secondary_startup_64_no_verify()
There is no need to use TESTL when checking the least-significant bit with a TEST instruction. Use TESTB, which is three bytes shorter: f6 05 00 00 00 00 01 testb $0x1,0x0(%rip) vs: f7 05 00 00 00 00 01 testl $0x1,0x0(%rip) 00 00 00 for the same effect. No functional changes intended. Signed-off-by: Uros Bizjak <ubizjak@gmail.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Link: https://lore.kernel.org/r/20231109201032.4439-1-ubizjak@gmail.com
1 parent 7a0a6d5 commit 7d28365

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/kernel/head_64.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ SYM_INNER_LABEL(secondary_startup_64_no_verify, SYM_L_GLOBAL)
182182
/* Enable PAE mode, PSE, PGE and LA57 */
183183
orl $(X86_CR4_PAE | X86_CR4_PSE | X86_CR4_PGE), %ecx
184184
#ifdef CONFIG_X86_5LEVEL
185-
testl $1, __pgtable_l5_enabled(%rip)
185+
testb $1, __pgtable_l5_enabled(%rip)
186186
jz 1f
187187
orl $X86_CR4_LA57, %ecx
188188
1:

0 commit comments

Comments
 (0)