Re: [PATCH] x86/kvm/nVMCS: fix VMCLEAR when Enlightened VMCS is in use

2019-06-26 Thread Paolo Bonzini
On 24/06/19 16:16, Vitaly Kuznetsov wrote: >>> gpa_t vmptr; >>> + u64 evmptr; >> I prefer to rename evmptr to evmcs_ptr. I think it’s more readable and >> sufficiently short. >> > Sure. > Let's make it evmcs_gpa instead. "*_ptr" or "p_*" should be for host pointers. Paolo

Re: [PATCH] x86/kvm/nVMCS: fix VMCLEAR when Enlightened VMCS is in use

2019-06-26 Thread Vitaly Kuznetsov
Liran Alon writes: >> On 24 Jun 2019, at 17:16, Vitaly Kuznetsov wrote: >> >> >> That said I'm ok with dropping nested_release_evmcs() for consistency >> but we can't just drop 'if (vmptr == vmx->nested.hv_evmcs_vmptr)’. > > Right. I meant that we can just change code to: > > /* Add relevant c

Re: [PATCH] x86/kvm/nVMCS: fix VMCLEAR when Enlightened VMCS is in use

2019-06-25 Thread Liran Alon
> On 25 Jun 2019, at 14:15, Vitaly Kuznetsov wrote: > > Liran Alon writes: > >>> On 25 Jun 2019, at 11:51, Vitaly Kuznetsov wrote: >>> >>> Liran Alon writes: >>> > On 24 Jun 2019, at 16:30, Vitaly Kuznetsov wrote: > > > +bool nested_enlightened_vmentry(struct kvm_vcpu

Re: [PATCH] x86/kvm/nVMCS: fix VMCLEAR when Enlightened VMCS is in use

2019-06-25 Thread Vitaly Kuznetsov
Liran Alon writes: >> On 25 Jun 2019, at 11:51, Vitaly Kuznetsov wrote: >> >> Liran Alon writes: >> On 24 Jun 2019, at 16:30, Vitaly Kuznetsov wrote: +bool nested_enlightened_vmentry(struct kvm_vcpu *vcpu, u64 *evmptr) >>> >>> I prefer to rename evmptr to evmcs_ptr. I

Re: [PATCH] x86/kvm/nVMCS: fix VMCLEAR when Enlightened VMCS is in use

2019-06-25 Thread Liran Alon
> On 25 Jun 2019, at 11:51, Vitaly Kuznetsov wrote: > > Liran Alon writes: > >>> On 24 Jun 2019, at 16:30, Vitaly Kuznetsov wrote: >>> >>> >>> +bool nested_enlightened_vmentry(struct kvm_vcpu *vcpu, u64 *evmptr) >> >> I prefer to rename evmptr to evmcs_ptr. I think it’s more readable and

Re: [PATCH] x86/kvm/nVMCS: fix VMCLEAR when Enlightened VMCS is in use

2019-06-25 Thread Vitaly Kuznetsov
Liran Alon writes: >> On 24 Jun 2019, at 16:30, Vitaly Kuznetsov wrote: >> >> >> +bool nested_enlightened_vmentry(struct kvm_vcpu *vcpu, u64 *evmptr) > > I prefer to rename evmptr to evmcs_ptr. I think it’s more readable and > sufficiently short. > In addition, I think you should return eithe

Re: [PATCH] x86/kvm/nVMCS: fix VMCLEAR when Enlightened VMCS is in use

2019-06-24 Thread Liran Alon
> On 24 Jun 2019, at 17:16, Vitaly Kuznetsov wrote: > > Liran Alon writes: > >>> On 24 Jun 2019, at 16:30, Vitaly Kuznetsov wrote: >>> >>> When Enlightened VMCS is in use, it is valid to do VMCLEAR and, >>> according to TLFS, this should "transition an enlightened VMCS from the >>> active

Re: [PATCH] x86/kvm/nVMCS: fix VMCLEAR when Enlightened VMCS is in use

2019-06-24 Thread Vitaly Kuznetsov
Liran Alon writes: >> On 24 Jun 2019, at 16:30, Vitaly Kuznetsov wrote: >> >> When Enlightened VMCS is in use, it is valid to do VMCLEAR and, >> according to TLFS, this should "transition an enlightened VMCS from the >> active to the non-active state". It is, however, wrong to assume that >> it

Re: [PATCH] x86/kvm/nVMCS: fix VMCLEAR when Enlightened VMCS is in use

2019-06-24 Thread Liran Alon
> On 24 Jun 2019, at 16:30, Vitaly Kuznetsov wrote: > > When Enlightened VMCS is in use, it is valid to do VMCLEAR and, > according to TLFS, this should "transition an enlightened VMCS from the > active to the non-active state". It is, however, wrong to assume that > it is only valid to do VMC