[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YKQmG3rMpwSI3WrV@google.com>
Date: Tue, 18 May 2021 20:39:55 +0000
From: Sean Christopherson <seanjc@...gle.com>
To: Vitaly Kuznetsov <vkuznets@...hat.com>
Cc: kvm@...r.kernel.org, Paolo Bonzini <pbonzini@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Jim Mattson <jmattson@...gle.com>,
Maxim Levitsky <mlevitsk@...hat.com>,
Kechen Lu <kechenl@...dia.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 3/5] KVM: x86: Use common 'enable_apicv' variable for
both APICv and AVIC
On Tue, May 18, 2021, Vitaly Kuznetsov wrote:
> Unify VMX and SVM code by moving APICv/AVIC enablement tracking to common
> 'enable_apicv' variable. Note: unlike APICv, AVIC is disabled by default.
>
> No functional change intended.
>
> Suggested-by: Sean Christopherson <seanjc@...gle.com>
> Signed-off-by: Vitaly Kuznetsov <vkuznets@...hat.com>
> ---
...
> diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
> index 8c3918a11826..0d6ec34d1e4b 100644
> --- a/arch/x86/kvm/svm/svm.c
> +++ b/arch/x86/kvm/svm/svm.c
> @@ -185,6 +185,10 @@ module_param(vls, int, 0444);
> static int vgif = true;
> module_param(vgif, int, 0444);
>
> +/* enable / disable AVIC */
> +static int avic;
> +module_param(avic, int, 0444);
We should opportunistically make avic a "bool".
> +
> bool __read_mostly dump_invalid_vmcb;
> module_param(dump_invalid_vmcb, bool, 0644);
>
> @@ -1009,14 +1013,15 @@ static __init int svm_hardware_setup(void)
> nrips = false;
> }
>
> - if (avic) {
> - if (!npt_enabled || !boot_cpu_has(X86_FEATURE_AVIC)) {
> - avic = false;
> - } else {
> - pr_info("AVIC enabled\n");
> + if (!npt_enabled || !boot_cpu_has(X86_FEATURE_AVIC))
> + avic = false;
>
> - amd_iommu_register_ga_log_notifier(&avic_ga_log_notifier);
> - }
> + /* 'enable_apicv' is common between VMX/SVM but the defaults differ */
-1 for not throwing Jim under the bus :-)
Nits aside,
Reviewed-by: Sean Christopherson <seanjc@...gle.com>
Powered by blists - more mailing lists