From: Zhao Liu <zhao1.liu@intel.com>
To: Xiaoyao Li <xiaoyao.li@intel.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
qemu-devel@nongnu.org, tao1.su@intel.com, chenyi.qiang@intel.com
Subject: Re: [PATCH v2] i386/cpu: Remove FEAT_24_0_EBX for AVX10
Date: Fri, 12 Sep 2025 18:46:57 +0800 [thread overview]
Message-ID: <aMP6IQ4TR/MW6C6u@intel.com> (raw)
In-Reply-To: <20250707141151.4187798-1-xiaoyao.li@intel.com>
Hi Xiaoyao,
Rethinking this patch, I would not remove these feature bits with the
comments inline:
> diff --git a/target/i386/cpu.c b/target/i386/cpu.c
> index 0d35e95430fe..1b50fd4e397d 100644
> --- a/target/i386/cpu.c
> +++ b/target/i386/cpu.c
> @@ -912,7 +912,6 @@ void x86_cpu_vendor_words2str(char *dst, uint32_t vendor1,
> #define TCG_SGX_12_0_EAX_FEATURES 0
> #define TCG_SGX_12_0_EBX_FEATURES 0
> #define TCG_SGX_12_1_EAX_FEATURES 0
> -#define TCG_24_0_EBX_FEATURES 0
>
> #if defined CONFIG_USER_ONLY
> #define CPUID_8000_0008_EBX_KERNEL_FEATURES (CPUID_8000_0008_EBX_IBPB | \
> @@ -1208,20 +1207,6 @@ FeatureWordInfo feature_word_info[FEATURE_WORDS] = {
> },
> .tcg_features = TCG_7_2_EDX_FEATURES,
> },
> - [FEAT_24_0_EBX] = {
> - .type = CPUID_FEATURE_WORD,
> - .feat_names = {
> - [16] = "avx10-128",
> - [17] = "avx10-256",
> - [18] = "avx10-512",
> - },
> - .cpuid = {
> - .eax = 0x24,
> - .needs_ecx = true, .ecx = 0,
> - .reg = R_EBX,
> - },
> - .tcg_features = TCG_24_0_EBX_FEATURES,
> - },
"Reserved at 1" means always enabling, not being deprecated.
So if someone has already cofigured "+avx10-128,+avx10-256,+avx10-512"
for his cpu, this patch will break his use.
Although explicitly setting AVX10 vector length feature bits appears
uncommon, but explicitly masking off these feature bits is even more
unusual.
Removing these bits has little benefit but brings the risk of breaking
the API.
In the future, QEMU may need the AVX10 model to handle different
versions. A complete feature list is necessary. This is another reason.
In addition, I also agree with KVM's point to keep these feature names:
https://lore.kernel.org/kvm/Zkz5Ak0PQlAN8DxK@google.com/
...
> @@ -7720,7 +7686,8 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
> *ecx = 0;
> *edx = 0;
> if ((env->features[FEAT_7_1_EDX] & CPUID_7_1_EDX_AVX10) && count == 0) {
> - *ebx = env->features[FEAT_24_0_EBX] | env->avx10_version;
> + /* bit 16-18 are reserved at 1 */
> + *ebx = (0x7U << 16) | env->avx10_version;
Hardcoding is not friendly for maintenance, and they are essentially
feature bits.
> }
> break;
> }
Thanks,
Zhao
next prev parent reply other threads:[~2025-09-12 10:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-07 14:11 [PATCH v2] i386/cpu: Remove FEAT_24_0_EBX for AVX10 Xiaoyao Li
2025-07-08 8:46 ` Zhao Liu
2025-09-12 5:44 ` Xiaoyao Li
2025-09-12 10:46 ` Zhao Liu [this message]
2025-09-15 8:24 ` Xiaoyao Li
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=aMP6IQ4TR/MW6C6u@intel.com \
--to=zhao1.liu@intel.com \
--cc=chenyi.qiang@intel.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=tao1.su@intel.com \
--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).