From: Tao Su <tao1.su@linux.intel.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org, zhao1.liu@intel.com, xiaoyao.li@intel.com
Subject: Re: [PATCH 4/8] target/i386: add AVX10 feature and AVX10 version property
Date: Wed, 30 Oct 2024 11:05:23 +0800 [thread overview]
Message-ID: <ZyGic6S+/lcuR36v@linux.bj.intel.com> (raw)
In-Reply-To: <20241029151858.550269-5-pbonzini@redhat.com>
On Tue, Oct 29, 2024 at 04:18:54PM +0100, Paolo Bonzini wrote:
> From: Tao Su <tao1.su@linux.intel.com>
[ ... ]
> static void max_x86_cpu_realize(DeviceState *dev, Error **errp)
> {
> Object *obj = OBJECT(dev);
> + X86CPU *cpu = X86_CPU(dev);
> + CPUX86State *env = &cpu->env;
>
> if (!object_property_get_int(obj, "family", &error_abort)) {
> if (X86_CPU(obj)->env.features[FEAT_8000_0001_EDX] & CPUID_EXT2_LM) {
> @@ -5351,6 +5357,14 @@ static void max_x86_cpu_realize(DeviceState *dev, Error **errp)
> }
> }
>
> + if ((env->features[FEAT_7_1_EDX] & CPUID_7_1_EDX_AVX10) && !env->avx10_version) {
CPUID_7_1_EDX_AVX10 is not set now and will be set in x86_cpu_realizefn().
How about just checking !env->avx10_version? Because cpu_x86_cpuid will
also check (env->features[FEAT_7_1_EDX] & CPUID_7_1_EDX_AVX10).
> + uint32_t eax, ebx, ecx, edx;
> + x86_cpu_get_supported_cpuid(0x24, 0,
> + &eax, &ebx, &ecx, &edx);
> +
> + env->avx10_version = ebx & 0xff;
> + }
> +
> x86_cpu_realizefn(dev, errp);
> }
>
> @@ -6331,6 +6345,9 @@ static void x86_cpu_load_model(X86CPU *cpu, X86CPUModel *model)
> */
> object_property_set_str(OBJECT(cpu), "vendor", def->vendor, &error_abort);
>
> + object_property_set_int(OBJECT(cpu), "avx10-version", def->avx10_version,
> + &error_abort);
NIT: avx10-version is defined as UINT8, is it better to use object_property_set_uint?
> +
> x86_cpu_apply_version_props(cpu, model);
>
> /*
> @@ -6859,6 +6876,16 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
> }
> break;
> }
> + case 0x24: {
> + *eax = 0;
> + *ebx = 0;
> + *ecx = 0;
> + *edx = 0;
> + if (env->features[FEAT_7_1_EDX] & CPUID_7_1_EDX_AVX10) {
> + *ebx = env->avx10_version;
> + }
The CPUIDs of vector lengths are missing here, according to your previous
comment, it should be:
+ if ((env->features[FEAT_7_1_EDX] & CPUID_7_1_EDX_AVX10) && count == 0) {
+ *ebx = env->features[FEAT_24_0_EBX] | env->avx10_version;
+ }
[ ... ]
next prev parent reply other threads:[~2024-10-30 3:11 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-29 15:18 [PATCH v2 0/8] Add AVX10.1 CPUID support and GraniteRapids-v2 model Paolo Bonzini
2024-10-29 15:18 ` [PATCH 1/8] target/i386: cpu: set correct supported XCR0 features for TCG Paolo Bonzini
2024-10-30 2:56 ` Zhao Liu
2024-10-29 15:18 ` [PATCH 2/8] target/i386: do not rely on ExtSaveArea for accelerator-supported XCR0 bits Paolo Bonzini
2024-10-30 3:50 ` Zhao Liu
2024-10-29 15:18 ` [PATCH 3/8] target/i386: return bool from x86_cpu_filter_features Paolo Bonzini
2024-10-30 5:19 ` Zhao Liu
2024-10-29 15:18 ` [PATCH 4/8] target/i386: add AVX10 feature and AVX10 version property Paolo Bonzini
2024-10-30 3:05 ` Tao Su [this message]
2024-10-30 8:09 ` Zhao Liu
2024-10-30 8:44 ` Zhao Liu
2024-10-30 9:37 ` Tao Su
2024-10-30 13:21 ` Zhao Liu
2024-10-30 14:05 ` Tao Su
2024-10-30 15:55 ` Zhao Liu
2024-10-31 4:39 ` Tao Su
2024-10-31 5:52 ` Xiaoyao Li
2024-10-31 6:07 ` Tao Su
2024-10-31 7:12 ` Zhao Liu
2024-10-31 7:18 ` Zhao Liu
2024-10-31 7:19 ` Tao Su
2024-10-29 15:18 ` [PATCH 5/8] target/i386: add CPUID.24 features for AVX10 Paolo Bonzini
2024-10-30 8:50 ` Zhao Liu
2024-10-29 15:18 ` [PATCH 6/8] target/i386: Add feature dependencies " Paolo Bonzini
2024-10-29 15:18 ` [PATCH 7/8] target/i386: Add AVX512 state when AVX10 is supported Paolo Bonzini
2024-10-29 20:11 ` Paolo Bonzini
2024-10-30 8:54 ` Zhao Liu
2024-10-29 15:18 ` [PATCH 8/8] target/i386: Introduce GraniteRapids-v2 model Paolo Bonzini
2024-10-30 3:18 ` [PATCH v2 0/8] Add AVX10.1 CPUID support and " Tao Su
2024-10-30 8:35 ` Paolo Bonzini
2024-10-30 8:52 ` 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=ZyGic6S+/lcuR36v@linux.bj.intel.com \
--to=tao1.su@linux.intel.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=xiaoyao.li@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.