From: Sean Christopherson <seanjc@google.com>
To: Jim Mattson <jmattson@google.com>
Cc: kvm@vger.kernel.org, pbonzini@redhat.com
Subject: Re: [PATCH 2/3] KVM: x86: Report CPUID.7.1 support on CPUs with CPUID.7 indices > 1
Date: Fri, 26 Aug 2022 23:54:04 +0000 [thread overview]
Message-ID: <YwldHBEo+7rg0sF3@google.com> (raw)
In-Reply-To: <20220826210019.1211302-2-jmattson@google.com>
On Fri, Aug 26, 2022, Jim Mattson wrote:
> Previously, KVM reported support for CPUID.(EAX=7,ECX=1) only if the
> maximum leaf 7 index on the host was exactly 1. A recent microcode
> patch for Ice Lake raised the maximum leaf 7 index from 0 to 2,
> skipping right over 1. Though that patch left CPUID.(EAX=7,ECX=1)
> filled with zeros on Ice Lake, it nonetheless exposed this bug.
>
> Report CPUID.(EAX=7,ECX=1) support if the maximum leaf 7 index on the
> host is at least 1.
>
> Cc: Sean Christopherson <seanjc@google.com>
> Fixes: bcf600ca8d21 ("KVM: x86: Remove the unnecessary loop on CPUID 0x7 sub-leafs")
> Signed-off-by: Jim Mattson <jmattson@google.com>
> ---
> arch/x86/kvm/cpuid.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
> index 07be45c5bb93..64cdabb3cb2c 100644
> --- a/arch/x86/kvm/cpuid.c
> +++ b/arch/x86/kvm/cpuid.c
> @@ -886,7 +886,7 @@ static inline int __do_cpuid_func(struct kvm_cpuid_array *array, u32 function)
> cpuid_entry_override(entry, CPUID_7_EDX);
>
> /* KVM only supports 0x7.0 and 0x7.1, capped above via min(). */
> - if (entry->eax == 1) {
> + if (entry->eax >= 1) {
But as the comment says, above this is:
entry->eax = min(entry->eax, 1u);
...
/* KVM only supports 0x7.0 and 0x7.1, capped above via min(). */
if (entry->eax == 1) {
What am I missing?
next prev parent reply other threads:[~2022-08-26 23:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-26 21:00 [PATCH 1/3] KVM: x86: Insert "AMD" in KVM_X86_FEATURE_PSFD Jim Mattson
2022-08-26 21:00 ` [PATCH 2/3] KVM: x86: Report CPUID.7.1 support on CPUs with CPUID.7 indices > 1 Jim Mattson
2022-08-26 23:54 ` Sean Christopherson [this message]
2022-08-27 16:51 ` Jim Mattson
2022-08-26 21:00 ` [PATCH 3/3] KVM: x86: Expose Predictive Store Forwarding Disable on Intel parts Jim Mattson
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=YwldHBEo+7rg0sF3@google.com \
--to=seanjc@google.com \
--cc=jmattson@google.com \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.com \
/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