x86: Fix wrong test for 5-level page-table
PATCH 1/1 x86: Fix wrong test for 5-level page-table
Untested, but clearly bit 12 is the one that needs to be tested.
--- x86/cstart64.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
x86/cstart64.S +1 -1
@@ -243,7 +243,7 @@ start64: setup_5level_page_table: /* Check if 5-level paging has already enabled */ mov %cr4, %rax - test $12, %eax + bt $12, %eax jnz lvl5 pushq $32
Signature · 1 line
2.17.1
Quoted 12 lines · Nadav Amit
Untested, but clearly bit 12 is the one that needs to be tested.
Signed-off-by Nadav Amit <[email protected]>--- x86/cstart64.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)x86/cstart64.S +0
-0
x86/cstart64.S start64: · line 247
Quoted 6 lines
x86/cstart64.S +1
-1@@ -243,7 +243,7 @@ start64: setup_5level_page_table: /* Check if 5-level paging has already enabled */ mov %cr4, %rax - test $12, %eax + bt $12, %eax jnz lvl5
Unfortunately BT doesn't affect RFLAGS.ZF, so 'jnz' needs to be changed to 'jc'. Or alternatively, do 'test $1000, %eax'.
Quoted 5 lines
x86/cstart64.S +0
-0pushq $32Signature · 1 line
2.17.1
Quoted 8 lines · Sean Christopherson
Quoted 7 lines · Nadav Amit
Untested, but clearly bit 12 is the one that needs to be tested.
Signed-off-by Nadav Amit <[email protected]>--- x86/cstart64.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 14 lines
x86/cstart64.S start64: · line 247
Quoted 11 lines
x86/cstart64.S +1
-1@@ -243,7 +243,7 @@ start64: setup_5level_page_table: /* Check if 5-level paging has already enabled */ mov %cr4, %rax - test $12, %eax + bt $12, %eax jnz lvl5Unfortunately BT doesn't affect RFLAGS.ZF, so 'jnz' needs to be changed to 'jc'. Or alternatively, do 'test $1000, %eax'.
And of course that should be $0x1000...
Quoted 10 lines · Sean Christopherson
Quoted 7 lines · Nadav Amit
Untested, but clearly bit 12 is the one that needs to be tested.
Signed-off-by Nadav Amit <[email protected]>---
x86/cstart64.S| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 14 lines
Quoted 11 lines
x86/cstart64.S +0
-0@@ -243,7 +243,7 @@ start64:
setup_5level_page_table:/* Check if 5-level paging has already enabled */ mov %cr4, %raxx86/cstart64.S +1
-1- test $12, %eax + bt $12, %eaxjnz lvl5
Unfortunately BT doesn't affect RFLAGS.ZF, so 'jnz' needs to be changed to 'jc'. Or alternatively, do 'test $1000, %eax'.
Of course. Stupid me, but it’s not worse than it was before ;-)
I’ll send a revised version. Thanks.