Skip to content

Commit 3ffe4b9

Browse files
0xAXZhengShunQian
authored andcommitted
x86/boot: Simplify kernel load address alignment check
commit a473314 upstream We are using %rax as temporary register to check the kernel address alignment. We don't really have to since the TEST instruction does not clobber the destination operand. Suggested-by: Brian Gerst <[email protected]> Signed-off-by: Alexander Kuleshov <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Cc: Alexander Popov <[email protected]> Cc: Andrey Ryabinin <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Denys Vlasenko <[email protected]> Cc: H. Peter Anvin <[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] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]> Signed-off-by: Srivatsa S. Bhat <[email protected]> Reviewed-by: Matt Helsley (VMware) <[email protected]> Reviewed-by: Alexey Makhalov <[email protected]> Reviewed-by: Bo Gan <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 8d9a9fe commit 3ffe4b9

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

arch/x86/kernel/head_64.S

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,7 @@ startup_64:
7676
subq $_text - __START_KERNEL_map, %rbp
7777

7878
/* Is the address not 2M aligned? */
79-
movq %rbp, %rax
80-
andl $~PMD_PAGE_MASK, %eax
81-
testl %eax, %eax
79+
testl $~PMD_PAGE_MASK, %ebp
8280
jnz bad_address
8381

8482
/*

0 commit comments

Comments
 (0)