Re: [PATCH 1/2] KVM: x86: fix ordering of cr0 initialization code in vmx_cpu_reset

2016-04-28 Thread Bruce Rogers
>>> On 4/26/2016 at 08:54 PM, Wanpeng Li wrote: > 2016-02-09 0:29 GMT+08:00 Bruce Rogers : > On 2/8/2016 at 08:09 AM, Paolo Bonzini wrote: >> >>> >>> On 03/02/2016 23:51, Bruce Rogers wrote: diff --git

Re: [PATCH 1/2] KVM: x86: fix ordering of cr0 initialization code in vmx_cpu_reset

2016-04-28 Thread Bruce Rogers
>>> On 4/26/2016 at 08:54 PM, Wanpeng Li wrote: > 2016-02-09 0:29 GMT+08:00 Bruce Rogers : > On 2/8/2016 at 08:09 AM, Paolo Bonzini wrote: >> >>> >>> On 03/02/2016 23:51, Bruce Rogers wrote: diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index e2951b6..21507b4 100644

Re: [PATCH 1/2] KVM: x86: fix ordering of cr0 initialization code in vmx_cpu_reset

2016-04-26 Thread Wanpeng Li
2016-02-09 0:29 GMT+08:00 Bruce Rogers : On 2/8/2016 at 08:09 AM, Paolo Bonzini wrote: > >> >> On 03/02/2016 23:51, Bruce Rogers wrote: >>> >>> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c >>> index e2951b6..21507b4 100644 >>> ---

Re: [PATCH 1/2] KVM: x86: fix ordering of cr0 initialization code in vmx_cpu_reset

2016-04-26 Thread Wanpeng Li
2016-02-09 0:29 GMT+08:00 Bruce Rogers : On 2/8/2016 at 08:09 AM, Paolo Bonzini wrote: > >> >> On 03/02/2016 23:51, Bruce Rogers wrote: >>> >>> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c >>> index e2951b6..21507b4 100644 >>> --- a/arch/x86/kvm/vmx.c >>> +++ b/arch/x86/kvm/vmx.c >>>

Re: [PATCH 1/2] KVM: x86: fix ordering of cr0 initialization code in vmx_cpu_reset

2016-04-22 Thread Bruce Rogers
>>> On 2/3/2016 at 04:18 PM, Nadav Amit wrote: > Oops. > > Anyhow, I see my patch has done a similar change in init_vmcb() , so you may > want to revert it as well. > > Nadav > > Bruce Rogers wrote: > >> Commit d28bc9dd25ce reversed the order of two

Re: [PATCH 1/2] KVM: x86: fix ordering of cr0 initialization code in vmx_cpu_reset

2016-04-22 Thread Bruce Rogers
>>> On 2/3/2016 at 04:18 PM, Nadav Amit wrote: > Oops. > > Anyhow, I see my patch has done a similar change in init_vmcb() , so you may > want to revert it as well. > > Nadav > > Bruce Rogers wrote: > >> Commit d28bc9dd25ce reversed the order of two lines which initialize cr0, >> allowing

Re: [PATCH 1/2] KVM: x86: fix ordering of cr0 initialization code in vmx_cpu_reset

2016-02-08 Thread Paolo Bonzini
On 08/02/2016 17:29, Bruce Rogers wrote: On 2/8/2016 at 08:09 AM, Paolo Bonzini wrote: > >> >> On 03/02/2016 23:51, Bruce Rogers wrote: >>> >>> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c >>> index e2951b6..21507b4 100644 >>> --- a/arch/x86/kvm/vmx.c >>> +++ b/arch/x86/kvm/vmx.c

Re: [PATCH 1/2] KVM: x86: fix ordering of cr0 initialization code in vmx_cpu_reset

2016-02-08 Thread Bruce Rogers
>>> On 2/8/2016 at 08:09 AM, Paolo Bonzini wrote: > > On 03/02/2016 23:51, Bruce Rogers wrote: >> >> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c >> index e2951b6..21507b4 100644 >> --- a/arch/x86/kvm/vmx.c >> +++ b/arch/x86/kvm/vmx.c >> @@ -4993,8 +4993,8 @@ static void

Re: [PATCH 1/2] KVM: x86: fix ordering of cr0 initialization code in vmx_cpu_reset

2016-02-08 Thread Paolo Bonzini
On 03/02/2016 23:51, Bruce Rogers wrote: > > diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c > index e2951b6..21507b4 100644 > --- a/arch/x86/kvm/vmx.c > +++ b/arch/x86/kvm/vmx.c > @@ -4993,8 +4993,8 @@ static void vmx_vcpu_reset(struct kvm_vcpu *vcpu, bool > init_event) >

Re: [PATCH 1/2] KVM: x86: fix ordering of cr0 initialization code in vmx_cpu_reset

2016-02-08 Thread Bruce Rogers
>>> On 2/8/2016 at 08:09 AM, Paolo Bonzini wrote: > > On 03/02/2016 23:51, Bruce Rogers wrote: >> >> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c >> index e2951b6..21507b4 100644 >> --- a/arch/x86/kvm/vmx.c >> +++ b/arch/x86/kvm/vmx.c >> @@ -4993,8 +4993,8 @@

Re: [PATCH 1/2] KVM: x86: fix ordering of cr0 initialization code in vmx_cpu_reset

2016-02-08 Thread Paolo Bonzini
On 08/02/2016 17:29, Bruce Rogers wrote: On 2/8/2016 at 08:09 AM, Paolo Bonzini wrote: > >> >> On 03/02/2016 23:51, Bruce Rogers wrote: >>> >>> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c >>> index e2951b6..21507b4 100644 >>> --- a/arch/x86/kvm/vmx.c >>> +++

Re: [PATCH 1/2] KVM: x86: fix ordering of cr0 initialization code in vmx_cpu_reset

2016-02-08 Thread Paolo Bonzini
On 03/02/2016 23:51, Bruce Rogers wrote: > > diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c > index e2951b6..21507b4 100644 > --- a/arch/x86/kvm/vmx.c > +++ b/arch/x86/kvm/vmx.c > @@ -4993,8 +4993,8 @@ static void vmx_vcpu_reset(struct kvm_vcpu *vcpu, bool > init_event) >

Re: [PATCH 1/2] KVM: x86: fix ordering of cr0 initialization code in vmx_cpu_reset

2016-02-03 Thread Bruce Rogers
I hadn't noticed that one - my testcase didn't encounter any issues on AMD. Anyways, it's probably best to revert that change as well. I'll add that in for a v2. Bruce >>> On 2/3/2016 at 04:18 PM, Nadav Amit wrote: > Oops. > > Anyhow, I see my patch has done a similar change in init_vmcb() ,

Re: [PATCH 1/2] KVM: x86: fix ordering of cr0 initialization code in vmx_cpu_reset

2016-02-03 Thread Nadav Amit
Oops. Anyhow, I see my patch has done a similar change in init_vmcb() , so you may want to revert it as well. Nadav Bruce Rogers wrote: > Commit d28bc9dd25ce reversed the order of two lines which initialize cr0, > allowing the current (old) cr0 value to mess up vcpu initialization. > This was

[PATCH 1/2] KVM: x86: fix ordering of cr0 initialization code in vmx_cpu_reset

2016-02-03 Thread Bruce Rogers
Commit d28bc9dd25ce reversed the order of two lines which initialize cr0, allowing the current (old) cr0 value to mess up vcpu initialization. This was observed in the checks for cr0 X86_CR0_WP bit in the context of kvm_mmu_reset_context(). Besides, setting vcpu->arch.cr0 after vmx_set_cr0() is

[PATCH 1/2] KVM: x86: fix ordering of cr0 initialization code in vmx_cpu_reset

2016-02-03 Thread Bruce Rogers
Commit d28bc9dd25ce reversed the order of two lines which initialize cr0, allowing the current (old) cr0 value to mess up vcpu initialization. This was observed in the checks for cr0 X86_CR0_WP bit in the context of kvm_mmu_reset_context(). Besides, setting vcpu->arch.cr0 after vmx_set_cr0() is

Re: [PATCH 1/2] KVM: x86: fix ordering of cr0 initialization code in vmx_cpu_reset

2016-02-03 Thread Nadav Amit
Oops. Anyhow, I see my patch has done a similar change in init_vmcb() , so you may want to revert it as well. Nadav Bruce Rogers wrote: > Commit d28bc9dd25ce reversed the order of two lines which initialize cr0, > allowing the current (old) cr0 value to mess up vcpu

Re: [PATCH 1/2] KVM: x86: fix ordering of cr0 initialization code in vmx_cpu_reset

2016-02-03 Thread Bruce Rogers
I hadn't noticed that one - my testcase didn't encounter any issues on AMD. Anyways, it's probably best to revert that change as well. I'll add that in for a v2. Bruce >>> On 2/3/2016 at 04:18 PM, Nadav Amit wrote: > Oops. > > Anyhow, I see my patch has done a similar