[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YoUXFmh9vef4CC+8@google.com>
Date: Wed, 18 May 2022 15:56:06 +0000
From: Sean Christopherson <seanjc@...gle.com>
To: Maxim Levitsky <mlevitsk@...hat.com>
Cc: kvm@...r.kernel.org, Wanpeng Li <wanpengli@...cent.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Jani Nikula <jani.nikula@...ux.intel.com>,
Paolo Bonzini <pbonzini@...hat.com>,
Tvrtko Ursulin <tvrtko.ursulin@...ux.intel.com>,
Rodrigo Vivi <rodrigo.vivi@...el.com>,
Zhenyu Wang <zhenyuw@...ux.intel.com>,
Joonas Lahtinen <joonas.lahtinen@...ux.intel.com>,
Tom Lendacky <thomas.lendacky@....com>,
Ingo Molnar <mingo@...hat.com>,
David Airlie <airlied@...ux.ie>,
Thomas Gleixner <tglx@...utronix.de>,
Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
intel-gfx@...ts.freedesktop.org, Daniel Vetter <daniel@...ll.ch>,
Borislav Petkov <bp@...en8.de>, Joerg Roedel <joro@...tes.org>,
linux-kernel@...r.kernel.org, Jim Mattson <jmattson@...gle.com>,
Zhi Wang <zhi.a.wang@...el.com>,
Brijesh Singh <brijesh.singh@....com>,
"H. Peter Anvin" <hpa@...or.com>,
intel-gvt-dev@...ts.freedesktop.org,
dri-devel@...ts.freedesktop.org
Subject: Re: [RFC PATCH v3 01/19] KVM: x86: document AVIC/APICv inhibit
reasons
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 <mlevitsk@...hat.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).
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
>
Powered by blists - more mailing lists