From: Ewan Hai <ewanhai-oc@zhaoxin.com>
To: "Zhao Liu" <zhao1.liu@intel.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Daniel P . Berrangé" <berrange@redhat.com>,
"Igor Mammedov" <imammedo@redhat.com>
Cc: Xiaoyao Li <xiaoyao.li@intel.com>, Tao Su <tao1.su@intel.com>,
Yi Lai <yi1.lai@intel.com>, Dapeng Mi <dapeng1.mi@intel.com>,
<qemu-devel@nongnu.org>
Subject: Re: [PATCH 2/4] i386/cpu: Mark CPUID 0x80000007[EBX] as reserved for Intel
Date: Fri, 27 Jun 2025 13:52:43 +0800 [thread overview]
Message-ID: <b7960fec-6a8e-428e-bc0d-d5573281ad5f@zhaoxin.com> (raw)
In-Reply-To: <20250627035129.2755537-3-zhao1.liu@intel.com>
On 6/27/25 11:51 AM, Zhao Liu wrote:
>
> Per SDM,
>
> 80000007H EAX Reserved = 0.
> EBX Reserved = 0.
> ECX Reserved = 0.
> EDX Bits 07-00: Reserved = 0.
> Bit 08: Invariant TSC available if 1.
> Bits 31-09: Reserved = 0.
>
> EAX/EBX/ECX in CPUID 0x80000007 leaf are reserved for Intel.
>
> At present, EAX is reserved for AMD, too. And AMD hasn't used ECX in
> QEMU. So these 2 registers are both left as 0.
>
> Therefore, only fix the EBX and excode it as 0 for Intel.
>
> Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
> ---
> target/i386/cpu.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/target/i386/cpu.c b/target/i386/cpu.c
> index 867e08236540..6d590a9af389 100644
> --- a/target/i386/cpu.c
> +++ b/target/i386/cpu.c
> @@ -8374,7 +8374,11 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
> }
> case 0x80000007:
> *eax = 0;
> - *ebx = env->features[FEAT_8000_0007_EBX];
> + if (cpu->vendor_cpuid_only_v2 && IS_INTEL_CPU(env)) {
Please add IS_ZHAOXIN_CPU(env), because Zhaoxin follows the SDM definition for
CPUID leaf 0x80000008.
> + *ebx = 0;
> + } else {
> + *ebx = env->features[FEAT_8000_0007_EBX];
> + }
> *ecx = 0;
> *edx = env->features[FEAT_8000_0007_EDX];
> break;
> --
> 2.34.1
>
next prev parent reply other threads:[~2025-06-27 9:40 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-27 3:51 [PATCH 0/4] i386/cpu: Clean Up Reserved CPUID Leaves for Intel Zhao Liu
2025-06-27 3:51 ` [PATCH 1/4] i386/cpu: Mark EBX/ECX/EDX in CPUID 0x80000000 leaf as reserved " Zhao Liu
2025-06-27 5:52 ` Ewan Hai
2025-06-27 8:20 ` Xiaoyao Li
2025-06-27 3:51 ` [PATCH 2/4] i386/cpu: Mark CPUID 0x80000007[EBX] " Zhao Liu
2025-06-27 5:52 ` Ewan Hai [this message]
2025-06-27 3:51 ` [PATCH 3/4] i386/cpu: Mark ECX/EDX in CPUID 0x80000008 leaf " Zhao Liu
2025-06-27 5:52 ` Ewan Hai
2025-06-27 8:24 ` Xiaoyao Li
2025-06-30 5:20 ` Zhao Liu
2025-07-01 1:00 ` Xiaoyao Li
2025-06-27 3:51 ` [PATCH 4/4] i386/cpu: Reorder CPUID leaves in cpu_x86_cpuid() Zhao Liu
2025-06-27 8:17 ` [PATCH 0/4] i386/cpu: Clean Up Reserved CPUID Leaves for Intel Xiaoyao Li
2025-07-07 0:55 ` Tao Su
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=b7960fec-6a8e-428e-bc0d-d5573281ad5f@zhaoxin.com \
--to=ewanhai-oc@zhaoxin.com \
--cc=berrange@redhat.com \
--cc=dapeng1.mi@intel.com \
--cc=imammedo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=tao1.su@intel.com \
--cc=xiaoyao.li@intel.com \
--cc=yi1.lai@intel.com \
--cc=zhao1.liu@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).