From: Dave Hansen <dave.hansen@intel.com>
To: Sean Christopherson <seanjc@google.com>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
x86@kernel.org, Paolo Bonzini <pbonzini@redhat.com>
Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
Sandipan Das <sandipan.das@amd.com>
Subject: Re: [PATCH] x86/cpufeatures: Add CPUID_LNX_5 to track recently added Linux-defined word
Date: Thu, 4 Apr 2024 17:33:06 -0700 [thread overview]
Message-ID: <01de50c9-3339-4bdf-a880-ae66a1a8051e@intel.com> (raw)
In-Reply-To: <20240405001614.924824-1-seanjc@google.com>
On 4/4/24 17:16, Sean Christopherson wrote:
> Add CPUID_LNX_5 to track cpufeatures' word 21, and add the appropriate
> compile-time assert in KVM to prevent direct lookups on the features in
> CPUID_LNX_5. KVM uses X86_FEATURE_* flags to manage guest CPUID, and so
> must translate features that are scattered by Linux from the Linux-defined
> bit to the hardware-defined bit, i.e. should never try to directly access
> scattered features in guest CPUID.
>
> Opportunistically add NR_CPUID_WORDS to enum cpuid_leafs, along with a
> compile-time assert in KVM's CPUID infrastructure to ensure that future
> additions update cpuid_leafs along with NCAPINTS.
>
> No functional change intended.
>
> Fixes: 7f274e609f3d ("x86/cpufeatures: Add new word for scattered features")
> Cc: Sandipan Das <sandipan.das@amd.com>
> Signed-off-by: Sean Christopherson <seanjc@google.com>
I don't think I noticed this KVM code before, or at least how it
depended on the enum. But the BUILD_BUG_ON() will surely make the
ignorant among us aware _now_. Looks good:
Acked-by: Dave Hansen <dave.hansen@linux.intel.com>
prev parent reply other threads:[~2024-04-05 0:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-05 0:16 Sean Christopherson
2024-04-05 0:33 ` Dave Hansen [this message]
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=01de50c9-3339-4bdf-a880-ae66a1a8051e@intel.com \
--to=dave.hansen@intel.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=sandipan.das@amd.com \
--cc=seanjc@google.com \
--cc=tglx@linutronix.de \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®