[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YYwiBbyUINIcGXp3@google.com>
Date: Wed, 10 Nov 2021 19:48:21 +0000
From: Sean Christopherson <seanjc@...gle.com>
To: Suravee Suthikulpanit <suravee.suthikulpanit@....com>
Cc: linux-kernel@...r.kernel.org, kvm@...r.kernel.org, x86@...nel.org,
pbonzini@...hat.com, joro@...tes.org, tglx@...utronix.de,
mingo@...hat.com, bp@...en8.de, peterz@...radead.org,
hpa@...or.com, thomas.lendacky@....com, jon.grimm@....com
Subject: Re: [PATCH 2/2] KVM: SVM: Extend host physical APIC ID field to
support more than 8-bit
On Wed, Nov 10, 2021, Suravee Suthikulpanit wrote:
> diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
> index 989685098b3e..0b066bb5149d 100644
> --- a/arch/x86/kvm/svm/svm.c
> +++ b/arch/x86/kvm/svm/svm.c
> @@ -1031,6 +1031,12 @@ static __init int svm_hardware_setup(void)
> nrips = false;
> }
>
> + if (avic) {
> + r = avic_init_host_physical_apicid_mask();
> + if (r)
> + avic = false;
> + }
Haven't yet dedicated any brain cells to the rest of the patch, but this can be
written as
if (avic && avic_init_host_physical_apicid_mask())
avic = false;
or
avic = avic && !avic_init_host_physical_apicid_mask();
But looking at the context below, combining everything would be preferable. I
would say split out the enable_apicv part to make it more obvious that enable_apicv
is merely a reflection of avic.
avic = avic && npt_enabled && boot_cpu_has(X86_FEATURE_AVIC) &&
!avic_init_host_physical_apicid_mask();
enable_apicv = avic;
> +
> enable_apicv = avic = avic && npt_enabled && boot_cpu_has(X86_FEATURE_AVIC);
>
> if (enable_apicv) {
Powered by blists - more mailing lists