On Wed, 2022-05-18 at 15:56 +0000, Sean Christopherson wrote:
> On Wed, Apr 27, 2022, Maxim Levitsky wrote:
> > These days there are too many AVIC/APICv inhibit
> > reasons, and it doesn't hurt to have some documentation
> > for them.
> 
> Please wrap at ~75 chars.
> 
> > Signed-off-by: Maxim Levitsky <mlevi...@redhat.com>
> > ---
> >  arch/x86/include/asm/kvm_host.h | 15 +++++++++++++++
> >  1 file changed, 15 insertions(+)
> > 
> > diff --git a/arch/x86/include/asm/kvm_host.h 
> > b/arch/x86/include/asm/kvm_host.h
> > index f164c6c1514a4..63eae00625bda 100644
> > --- a/arch/x86/include/asm/kvm_host.h
> > +++ b/arch/x86/include/asm/kvm_host.h
> > @@ -1046,14 +1046,29 @@ struct kvm_x86_msr_filter {
> >  };
> >  
> >  enum kvm_apicv_inhibit {
> > +   /* APICv/AVIC is disabled by module param and/or not supported in 
> > hardware */
> 
> Rather than tag every one as APICv vs. AVIC, what about reorganizing the 
> enums so
> that the common vs. AVIC flags are bundled together?  And then the redundant 
> info
> in the comments about "XYZ is inhibited" can go away too, i.e. the individual
> comments can focus on explaining what triggers the inhibit (and for some, why 
> that
> action is incompatible with APIC virtualization).

Very good idea, will do!

Best regards,
        Maxim Levitsky

> 
> E.g.
>       /***************************************************************/
>       /* INHIBITs are relevant to both Intel's APICv and AMD's AVIC. */
>       /***************************************************************/
> 
>       /* APIC/AVIC is unsupported and/or disabled via module param. */
>       APICV_INHIBIT_REASON_DISABLE,
> 
>       /* The local APIC is not in-kernel.  See KVM_CREATE_IRQCHIP. */
>       APICV_INHIBIT_REASON_ABSENT,
> 
>       /*
>        * At least one IRQ vector is configured for HyperV's AutoEOI, which
>        * requires manually injecting the IRQ to do EOI on behalf of the guest.
>        */
>       APICV_INHIBIT_REASON_HYPERV,
>       
> 
>       /**********************************************/
>       /* INHIBITs relevant only to AMD's AVIC. */
>       /**********************************************/
> 
> >     APICV_INHIBIT_REASON_DISABLE,
> > +   /* APICv/AVIC is inhibited because AutoEOI feature is being used by a 
> > HyperV guest*/
> >     APICV_INHIBIT_REASON_HYPERV,
> > +   /* AVIC is inhibited on a CPU because it runs a nested guest */
> >     APICV_INHIBIT_REASON_NESTED,
> > +   /* AVIC is inhibited due to wait for an irq window (AVIC doesn't 
> > support this) */
> >     APICV_INHIBIT_REASON_IRQWIN,
> > +   /*
> > +    * AVIC is inhibited because i8254 're-inject' mode is used
> > +    * which needs EOI intercept which AVIC doesn't support
> > +    */
> >     APICV_INHIBIT_REASON_PIT_REINJ,
> > +   /* AVIC is inhibited because the guest has x2apic in its CPUID*/
> >     APICV_INHIBIT_REASON_X2APIC,
> > +   /* AVIC/APICv is inhibited because KVM_GUESTDBG_BLOCKIRQ was enabled */
> >     APICV_INHIBIT_REASON_BLOCKIRQ,
> > +   /*
> > +    * AVIC/APICv is inhibited because the guest didn't yet
> 
> s/guest/userspace
> 
> > +    * enable kernel/split irqchip
> > +    */
> >     APICV_INHIBIT_REASON_ABSENT,
> > +   /* AVIC is disabled because SEV doesn't support it */
> >     APICV_INHIBIT_REASON_SEV,
> >  };
> >  
> > -- 
> > 2.26.3
> > 


Reply via email to