* [kvm-unit-tests PATCH] x86: Fix wrong test for 5-level page-table
@ 2019-04-10 21:13 Nadav Amit
2019-04-11 13:41 ` Sean Christopherson
0 siblings, 1 reply; 4+ messages in thread
From: Nadav Amit @ 2019-04-10 21:13 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: Radim Krčmář, kvm, Nadav Amit
Untested, but clearly bit 12 is the one that needs to be tested.
Signed-off-by: Nadav Amit <nadav.amit@gmail.com>
---
x86/cstart64.S | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/x86/cstart64.S b/x86/cstart64.S
index 21db10f..8626f02 100644
--- a/x86/cstart64.S
+++ b/x86/cstart64.S
@@ -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
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [kvm-unit-tests PATCH] x86: Fix wrong test for 5-level page-table
2019-04-10 21:13 [kvm-unit-tests PATCH] x86: Fix wrong test for 5-level page-table Nadav Amit
@ 2019-04-11 13:41 ` Sean Christopherson
2019-04-11 13:44 ` Sean Christopherson
2019-04-11 16:47 ` Nadav Amit
0 siblings, 2 replies; 4+ messages in thread
From: Sean Christopherson @ 2019-04-11 13:41 UTC (permalink / raw)
To: Nadav Amit; +Cc: Paolo Bonzini, Radim Krčmář, kvm
On Wed, Apr 10, 2019 at 02:13:34PM -0700, Nadav Amit wrote:
> Untested, but clearly bit 12 is the one that needs to be tested.
>
> Signed-off-by: Nadav Amit <nadav.amit@gmail.com>
> ---
> x86/cstart64.S | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/x86/cstart64.S b/x86/cstart64.S
> index 21db10f..8626f02 100644
> --- a/x86/cstart64.S
> +++ b/x86/cstart64.S
> @@ -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'.
>
> pushq $32
> --
> 2.17.1
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [kvm-unit-tests PATCH] x86: Fix wrong test for 5-level page-table
2019-04-11 13:41 ` Sean Christopherson
@ 2019-04-11 13:44 ` Sean Christopherson
2019-04-11 16:47 ` Nadav Amit
1 sibling, 0 replies; 4+ messages in thread
From: Sean Christopherson @ 2019-04-11 13:44 UTC (permalink / raw)
To: Nadav Amit; +Cc: Paolo Bonzini, Radim Krčmář, kvm
On Thu, Apr 11, 2019 at 06:41:05AM -0700, Sean Christopherson wrote:
> On Wed, Apr 10, 2019 at 02:13:34PM -0700, Nadav Amit wrote:
> > Untested, but clearly bit 12 is the one that needs to be tested.
> >
> > Signed-off-by: Nadav Amit <nadav.amit@gmail.com>
> > ---
> > x86/cstart64.S | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/x86/cstart64.S b/x86/cstart64.S
> > index 21db10f..8626f02 100644
> > --- a/x86/cstart64.S
> > +++ b/x86/cstart64.S
> > @@ -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'.
And of course that should be $0x1000...
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [kvm-unit-tests PATCH] x86: Fix wrong test for 5-level page-table
2019-04-11 13:41 ` Sean Christopherson
2019-04-11 13:44 ` Sean Christopherson
@ 2019-04-11 16:47 ` Nadav Amit
1 sibling, 0 replies; 4+ messages in thread
From: Nadav Amit @ 2019-04-11 16:47 UTC (permalink / raw)
To: Sean Christopherson; +Cc: Paolo Bonzini, Radim Krčmář, kvm
> On Apr 11, 2019, at 6:41 AM, Sean Christopherson <sean.j.christopherson@intel.com> wrote:
>
> On Wed, Apr 10, 2019 at 02:13:34PM -0700, Nadav Amit wrote:
>> Untested, but clearly bit 12 is the one that needs to be tested.
>>
>> Signed-off-by: Nadav Amit <nadav.amit@gmail.com>
>> ---
>> x86/cstart64.S | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/x86/cstart64.S b/x86/cstart64.S
>> index 21db10f..8626f02 100644
>> --- a/x86/cstart64.S
>> +++ b/x86/cstart64.S
>> @@ -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'.
Of course. Stupid me, but it’s not worse than it was before ;-)
I’ll send a revised version. Thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-04-11 16:47 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-10 21:13 [kvm-unit-tests PATCH] x86: Fix wrong test for 5-level page-table Nadav Amit
2019-04-11 13:41 ` Sean Christopherson
2019-04-11 13:44 ` Sean Christopherson
2019-04-11 16:47 ` Nadav Amit
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.