lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aYpTeJK96r_fuFt4@google.com>
Date: Mon, 9 Feb 2026 13:36:56 -0800
From: Sean Christopherson <seanjc@...gle.com>
To: Naveen N Rao <naveen@...nel.org>
Cc: Paolo Bonzini <pbonzini@...hat.com>, kvm@...r.kernel.org, linux-kernel@...r.kernel.org, 
	Jim Mattson <jmattson@...gle.com>, "Maciej S . Szmigiero" <maciej.szmigiero@...cle.com>
Subject: Re: [PATCH 1/2] KVM: SVM: Initialize AVIC VMCB fields if AVIC is
 enabled with in-kernel APIC

On Mon, Feb 09, 2026, Naveen N Rao wrote:
> On Fri, Feb 06, 2026 at 10:17:29AM -0800, Sean Christopherson wrote:
> > > >  arch/x86/kvm/svm/avic.c | 2 +-
> > > >  arch/x86/kvm/svm/svm.c  | 2 +-
> > > >  2 files changed, 2 insertions(+), 2 deletions(-)
> > > > 
> > > > diff --git a/arch/x86/kvm/svm/avic.c b/arch/x86/kvm/svm/avic.c
> > > > index f92214b1a938..44e07c27b190 100644
> > > > --- a/arch/x86/kvm/svm/avic.c
> > > > +++ b/arch/x86/kvm/svm/avic.c
> > > > @@ -368,7 +368,7 @@ void avic_init_vmcb(struct vcpu_svm *svm, struct vmcb *vmcb)
> > > >  	vmcb->control.avic_physical_id = __sme_set(__pa(kvm_svm->avic_physical_id_table));
> > > >  	vmcb->control.avic_vapic_bar = APIC_DEFAULT_PHYS_BASE;
> > > >  
> > > > -	if (kvm_apicv_activated(svm->vcpu.kvm))
> > > > +	if (kvm_vcpu_apicv_active(&svm->vcpu))
> > > >  		avic_activate_vmcb(svm);
> > > >  	else
> > > >  		avic_deactivate_vmcb(svm);
> > > > diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
> > > > index 5f0136dbdde6..e8313fdc5465 100644
> > > > --- a/arch/x86/kvm/svm/svm.c
> > > > +++ b/arch/x86/kvm/svm/svm.c
> > > > @@ -1189,7 +1189,7 @@ static void init_vmcb(struct kvm_vcpu *vcpu, bool init_event)
> > > >  	if (guest_cpu_cap_has(vcpu, X86_FEATURE_ERAPS))
> > > >  		svm->vmcb->control.erap_ctl |= ERAP_CONTROL_ALLOW_LARGER_RAP;
> > > >  
> > > > -	if (kvm_vcpu_apicv_active(vcpu))
> > > > +	if (enable_apicv && irqchip_in_kernel(vcpu->kvm))
> > > >  		avic_init_vmcb(svm, vmcb);
> > > 
> > > Doesn't have to be done as part of this series, but I'm wondering if it 
> > > makes sense to turn this into a helper to clarify the intent and to make 
> > > it more obvious:
> > 
> > Hmm, yeah, though my only hesitation is the name.  For whatever reason, "possible"
> > makes me think "is APICv possible *right now*" (ignoring that I wrote exactly that
> > in the changelog).
> > 
> > What if we go with kvm_can_use_apicv()?  That would align with vmx_can_use_ipiv()
> > and vmx_can_use_vtd_pi(), which are pretty much identical in concept.
> 
> Yes, that's better. I'll use that and post it as a subsequent cleanup, 
> unless you want to pick it up rightaway.

Go ahead and post it separately, it's nice to have a proper paper trail.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ