[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z8CH6_hYMKYk0doi@google.com>
Date: Thu, 27 Feb 2025 07:42:35 -0800
From: Sean Christopherson <seanjc@...gle.com>
To: Pankaj Gupta <pankaj.gupta@....com>
Cc: Paolo Bonzini <pbonzini@...hat.com>, kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
Naveen N Rao <naveen@...nel.org>, Kim Phillips <kim.phillips@....com>,
Tom Lendacky <thomas.lendacky@....com>, Alexey Kardashevskiy <aik@....com>
Subject: Re: [PATCH v2 05/10] KVM: SVM: Require AP's "requested" SEV_FEATURES
to match KVM's view
On Thu, Feb 27, 2025, Pankaj Gupta wrote:
>
> > > > diff --git a/arch/x86/kvm/svm/sev.c b/arch/x86/kvm/svm/sev.c
> > > > index 9aad0dae3a80..bad5834ec143 100644
> > > > --- a/arch/x86/kvm/svm/sev.c
> > > > +++ b/arch/x86/kvm/svm/sev.c
> > > > @@ -3932,6 +3932,7 @@ void sev_snp_init_protected_guest_state(struct kvm_vcpu *vcpu)
> > > > static int sev_snp_ap_creation(struct vcpu_svm *svm)
> > > > {
> > > > + struct kvm_sev_info *sev = to_kvm_sev_info(svm->vcpu.kvm);
> > > > struct kvm_vcpu *vcpu = &svm->vcpu;
> > > > struct kvm_vcpu *target_vcpu;
> > > > struct vcpu_svm *target_svm;
> > > > @@ -3963,26 +3964,18 @@ static int sev_snp_ap_creation(struct vcpu_svm *svm)
> > > > mutex_lock(&target_svm->sev_es.snp_vmsa_mutex);
> > > > - /* Interrupt injection mode shouldn't change for AP creation */
> > > > - if (request < SVM_VMGEXIT_AP_DESTROY) {
> > > > - u64 sev_features;
> > > > -
> > > > - sev_features = vcpu->arch.regs[VCPU_REGS_RAX];
> > > > - sev_features ^= to_kvm_sev_info(svm->vcpu.kvm)->vmsa_features;
> > > > -
> > > > - if (sev_features & SVM_SEV_FEAT_INT_INJ_MODES) {
> > >
> > > 'SVM_SEV_FEAT_INT_INJ_MODES' would even be required in any future use-case,
> > > maybe?
> >
> > Can you elaborate? I don't quite follow what you're suggesting.
>
> SVM_SEV_FEAT_INT_INJ_MODES macro is not used anymore? If there is no plan to
> use it, maybe we can remove that as well?
Ah, gotcha. I didn't realize it was a compound macro. Yeah, unless someone
objects, I'll remove it when applying.
Powered by blists - more mailing lists