From: "Yang, Weijiang" <weijiang.yang@intel.com>
To: Xiaoyao Li <xiaoyao.li@intel.com>
Cc: "kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
Paolo Bonzini <pbonzini@redhat.com>,
Marcelo Tosatti <mtosatti@redhat.com>
Subject: Re: [PATCH v2 3/3] i386/cpuid: Move leaf 7 to correct group
Date: Tue, 27 Jun 2023 17:30:09 +0800 [thread overview]
Message-ID: <f7817f4f-13ef-6cda-f001-5cc16f340bd1@intel.com> (raw)
In-Reply-To: <20230613131929.720453-4-xiaoyao.li@intel.com>
On 6/13/2023 9:19 PM, Xiaoyao Li wrote:
> CPUID leaf 7 was grouped together with SGX leaf 0x12 by commit
> b9edbadefb9e ("i386: Propagate SGX CPUID sub-leafs to KVM") by mistake.
>
> SGX leaf 0x12 has its specific logic to check if subleaf (starting from 2)
> is valid or not by checking the bit 0:3 of corresponding EAX is 1 or
> not.
>
> Leaf 7 follows the logic that EAX of subleaf 0 enumerates the maximum
> valid subleaf.
>
> Fixes: b9edbadefb9e ("i386: Propagate SGX CPUID sub-leafs to KVM")
> Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
> ---
> target/i386/kvm/kvm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c
> index d7e235ce35a6..86aab9ca4ba2 100644
> --- a/target/i386/kvm/kvm.c
> +++ b/target/i386/kvm/kvm.c
> @@ -1993,7 +1993,6 @@ int kvm_arch_init_vcpu(CPUState *cs)
> c = &cpuid_data.entries[cpuid_i++];
> }
> break;
> - case 0x7:
> case 0x12:
> for (j = 0; ; j++) {
> c->function = i;
> @@ -2013,6 +2012,7 @@ int kvm_arch_init_vcpu(CPUState *cs)
> c = &cpuid_data.entries[cpuid_i++];
> }
> break;
> + case 0x7:
> case 0x14:
> case 0x1d:
> case 0x1e: {
Reviewed-by:Yang Weijiang <weijiang.yang@intel.com>
prev parent reply other threads:[~2023-06-27 9:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-13 13:19 [PATCH v2 0/3] i386: Minor fixes of building CPUIDs Xiaoyao Li
2023-06-13 13:19 ` [PATCH v2 1/3] i386/cpuid: Decrease cpuid_i when skipping CPUID leaf 1F Xiaoyao Li
2023-06-27 9:26 ` Yang, Weijiang
2023-06-13 13:19 ` [PATCH v2 2/3] i386/cpuid: Remove subleaf constraint on " Xiaoyao Li
2023-06-27 9:29 ` Yang, Weijiang
2023-06-13 13:19 ` [PATCH v2 3/3] i386/cpuid: Move leaf 7 to correct group Xiaoyao Li
2023-06-27 9:30 ` Yang, Weijiang [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=f7817f4f-13ef-6cda-f001-5cc16f340bd1@intel.com \
--to=weijiang.yang@intel.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=xiaoyao.li@intel.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;
as well as URLs for NNTP newsgroup(s).