Re: [PATCH v2 1/2] KVM: SVM: Move asid to vcpu_svm

2020-11-30 Thread Ashish Kalra
Hello Paolo, I believe one of my teammates is currently working on adding a KVM selftest for SEV and SEV-ES. Thanks, Ashish On Mon, Nov 30, 2020 at 03:41:41PM +0100, Paolo Bonzini wrote: > On 29/11/20 10:41, Ashish Kalra wrote: > > From: Ashish Kalra > > > > This patch breaks SEV guests. > >

Re: [PATCH v2 1/2] KVM: SVM: Move asid to vcpu_svm

2020-11-30 Thread Paolo Bonzini
On 29/11/20 10:41, Ashish Kalra wrote: From: Ashish Kalra This patch breaks SEV guests. The patch stores current ASID in struct vcpu_svm and only moves it to VMCB in svm_vcpu_run(), but by doing so, the ASID allocated for SEV guests and setup in vmcb->control.asid by pre_sev_run() gets

Re: [PATCH v2 1/2] KVM: SVM: Move asid to vcpu_svm

2020-11-29 Thread Ashish Kalra
From: Ashish Kalra This patch breaks SEV guests. The patch stores current ASID in struct vcpu_svm and only moves it to VMCB in svm_vcpu_run(), but by doing so, the ASID allocated for SEV guests and setup in vmcb->control.asid by pre_sev_run() gets over-written by this ASID stored in struct

Re: [PATCH v2 1/2] KVM: SVM: Move asid to vcpu_svm

2020-11-13 Thread Paolo Bonzini
On 13/10/20 03:29, Sean Christopherson wrote: @@ -3446,6 +3447,7 @@ static __no_kcsan fastpath_t svm_vcpu_run(struct kvm_vcpu *vcpu) sync_lapic_to_cr8(vcpu); + svm->vmcb->control.asid = svm->asid; Related to the above, handling this in vcpu_run() feels wrong. There really shouldn't

Re: [PATCH v2 1/2] KVM: SVM: Move asid to vcpu_svm

2020-11-13 Thread Paolo Bonzini
On 11/10/20 20:48, Cathy Avery wrote: Move asid to svm->asid to allow for vmcb assignment during svm_vcpu_run without regard to which level guest is running. Slightly more verbose commit message: KVM does not have separate ASIDs for L1 and L2; either the nested hypervisor and nested guests

Re: [PATCH v2 1/2] KVM: SVM: Move asid to vcpu_svm

2020-10-12 Thread Sean Christopherson
On Sun, Oct 11, 2020 at 02:48:17PM -0400, Cathy Avery wrote: > Move asid to svm->asid to allow for vmcb assignment This is misleading. The asid isn't being moved, it's being copied/tracked. The "to allow" wording also confused me; I though this was just a prep patch and the actual assignment was

[PATCH v2 1/2] KVM: SVM: Move asid to vcpu_svm

2020-10-11 Thread Cathy Avery
Move asid to svm->asid to allow for vmcb assignment during svm_vcpu_run without regard to which level guest is running. Signed-off-by: Cathy Avery --- arch/x86/kvm/svm/svm.c | 4 +++- arch/x86/kvm/svm/svm.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git