[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fpb6l3xwyksd7s5izmrhr4hfrkmfeavbgfatokgl5sdeh75mtx@f6gcad774zeh>
Date: Thu, 19 Jun 2025 17:31:04 +0530
From: Naveen N Rao <naveen@...nel.org>
To: Sean Christopherson <seanjc@...gle.com>
Cc: Marc Zyngier <maz@...nel.org>, Oliver Upton <oliver.upton@...ux.dev>,
Paolo Bonzini <pbonzini@...hat.com>, Joerg Roedel <joro@...tes.org>,
David Woodhouse <dwmw2@...radead.org>, Lu Baolu <baolu.lu@...ux.intel.com>,
linux-arm-kernel@...ts.infradead.org, kvmarm@...ts.linux.dev, kvm@...r.kernel.org,
iommu@...ts.linux.dev, linux-kernel@...r.kernel.org, Sairaj Kodilkar <sarunkod@....com>,
Vasant Hegde <vasant.hegde@....com>, Maxim Levitsky <mlevitsk@...hat.com>,
Joao Martins <joao.m.martins@...cle.com>, Francesco Lavra <francescolavra.fl@...il.com>,
David Matlack <dmatlack@...gle.com>
Subject: Re: [PATCH v3 17/62] KVM: SVM: Add enable_ipiv param, never set
IsRunning if disabled
On Thu, Jun 19, 2025 at 05:01:30PM +0530, Naveen N Rao wrote:
> On Wed, Jun 11, 2025 at 03:45:20PM -0700, Sean Christopherson wrote:
> > @@ -1030,7 +1047,7 @@ void avic_vcpu_put(struct kvm_vcpu *vcpu)
> > * can't be scheduled out and thus avic_vcpu_{put,load}() can't run
> > * recursively.
> > */
> > - entry = READ_ONCE(kvm_svm->avic_physical_id_table[vcpu->vcpu_id]);
> > + entry = svm->avic_physical_id_entry;
> >
> > /* Nothing to do if IsRunning == '0' due to vCPU blocking. */
> > if (!(entry & AVIC_PHYSICAL_ID_ENTRY_IS_RUNNING_MASK))
> > @@ -1049,7 +1066,10 @@ void avic_vcpu_put(struct kvm_vcpu *vcpu)
> > avic_update_iommu_vcpu_affinity(vcpu, -1, 0);
> >
> > entry &= ~AVIC_PHYSICAL_ID_ENTRY_IS_RUNNING_MASK;
> > - WRITE_ONCE(kvm_svm->avic_physical_id_table[vcpu->vcpu_id], entry);
> > + svm->avic_physical_id_entry = entry;
> > +
> > + if (enable_ipiv)
> > + WRITE_ONCE(kvm_svm->avic_physical_id_table[vcpu->vcpu_id], entry);
>
> If enable_ipiv is false, then isRunning bit will never be set and we
> would have bailed out earlier. So, the check for enable_ipiv can be
> dropped here (or converted into an assert).
Ignore this, I got this wrong, sorry. The earlier check is against the
local copy of the physical ID table entry, which will indeed have
isRunning set so this is all good.
- Naveen
Powered by blists - more mailing lists