All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
	x86@kernel.org, pbonzini@redhat.com, joro@8bytes.org,
	tglx@linutronix.de, mingo@redhat.com, bp@alien8.de,
	peterz@infradead.org, hpa@zytor.com, thomas.lendacky@amd.com,
	jon.grimm@amd.com
Subject: Re: [PATCH 2/2] KVM: SVM: Extend host physical APIC ID field to support more than 8-bit
Date: Wed, 10 Nov 2021 19:48:21 +0000	[thread overview]
Message-ID: <YYwiBbyUINIcGXp3@google.com> (raw)
In-Reply-To: <20211110101805.16343-3-suravee.suthikulpanit@amd.com>

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) {

  reply	other threads:[~2021-11-10 19:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-10 10:18 [PATCH 0/2] svm: avic: Allow AVIC support on system w/ physical APIC ID > 255 Suravee Suthikulpanit
2021-11-10 10:18 ` [PATCH 1/2] x86/apic: Add helper function to get maximum physical APIC ID Suravee Suthikulpanit
2021-11-10 10:18 ` [PATCH 2/2] KVM: SVM: Extend host physical APIC ID field to support more than 8-bit Suravee Suthikulpanit
2021-11-10 19:48   ` Sean Christopherson [this message]
2021-11-16 10:29     ` Suthikulpanit, Suravee
2021-11-17 13:06   ` Paolo Bonzini
2021-12-01 15:13     ` Suthikulpanit, Suravee

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YYwiBbyUINIcGXp3@google.com \
    --to=seanjc@google.com \
    --cc=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=jon.grimm@amd.com \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peterz@infradead.org \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=tglx@linutronix.de \
    --cc=thomas.lendacky@amd.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.