[PATCH 2/6] target/i386: add avx10-version property

Tao Su posted 6 patches 3 weeks, 5 days ago
There is a newer version of this series
[PATCH 2/6] target/i386: add avx10-version property
Posted by Tao Su 3 weeks, 5 days ago
Introduce avx10-version property so that avx10 version can be controlled
by user and cpu model. Per spec, avx10 version can never be 0, the default
value of avx10-version is set to 0 to determine whether it is specified by
user.

Tested-by: Xuelian Guo <xuelian.guo@intel.com>
Signed-off-by: Tao Su <tao1.su@linux.intel.com>
---
 target/i386/cpu.c | 1 +
 target/i386/cpu.h | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index d845ff5e4e..5b434a107a 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -8343,6 +8343,7 @@ static Property x86_cpu_properties[] = {
     DEFINE_PROP_UINT32("min-level", X86CPU, env.cpuid_min_level, 0),
     DEFINE_PROP_UINT32("min-xlevel", X86CPU, env.cpuid_min_xlevel, 0),
     DEFINE_PROP_UINT32("min-xlevel2", X86CPU, env.cpuid_min_xlevel2, 0),
+    DEFINE_PROP_UINT8("avx10-version", X86CPU, env.avx10_version, 0),
     DEFINE_PROP_UINT64("ucode-rev", X86CPU, ucode_rev, 0),
     DEFINE_PROP_BOOL("full-cpuid-auto-level", X86CPU, full_cpuid_auto_level, true),
     DEFINE_PROP_STRING("hv-vendor-id", X86CPU, hyperv_vendor),
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
index 280bec701c..d845384dcd 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
@@ -1920,6 +1920,8 @@ typedef struct CPUArchState {
     uint32_t cpuid_vendor3;
     uint32_t cpuid_version;
     FeatureWordArray features;
+    /* AVX10 version */
+    uint8_t avx10_version;
     /* Features that were explicitly enabled/disabled */
     FeatureWordArray user_features;
     uint32_t cpuid_model[12];
-- 
2.34.1
Re: [PATCH 2/6] target/i386: add avx10-version property
Posted by Xiaoyao Li 3 weeks, 5 days ago
On 10/28/2024 10:45 AM, Tao Su wrote:
> Introduce avx10-version property so that avx10 version can be controlled
> by user and cpu model. Per spec, avx10 version can never be 0, the default
> value of avx10-version is set to 0 to determine whether it is specified by
> user.

I think it's better to merge this patch into next one. It's intact to 
show how avx10_version is supposed to work.

> Tested-by: Xuelian Guo <xuelian.guo@intel.com>
> Signed-off-by: Tao Su <tao1.su@linux.intel.com>
> ---
>   target/i386/cpu.c | 1 +
>   target/i386/cpu.h | 2 ++
>   2 files changed, 3 insertions(+)
> 
> diff --git a/target/i386/cpu.c b/target/i386/cpu.c
> index d845ff5e4e..5b434a107a 100644
> --- a/target/i386/cpu.c
> +++ b/target/i386/cpu.c
> @@ -8343,6 +8343,7 @@ static Property x86_cpu_properties[] = {
>       DEFINE_PROP_UINT32("min-level", X86CPU, env.cpuid_min_level, 0),
>       DEFINE_PROP_UINT32("min-xlevel", X86CPU, env.cpuid_min_xlevel, 0),
>       DEFINE_PROP_UINT32("min-xlevel2", X86CPU, env.cpuid_min_xlevel2, 0),
> +    DEFINE_PROP_UINT8("avx10-version", X86CPU, env.avx10_version, 0),
>       DEFINE_PROP_UINT64("ucode-rev", X86CPU, ucode_rev, 0),
>       DEFINE_PROP_BOOL("full-cpuid-auto-level", X86CPU, full_cpuid_auto_level, true),
>       DEFINE_PROP_STRING("hv-vendor-id", X86CPU, hyperv_vendor),
> diff --git a/target/i386/cpu.h b/target/i386/cpu.h
> index 280bec701c..d845384dcd 100644
> --- a/target/i386/cpu.h
> +++ b/target/i386/cpu.h
> @@ -1920,6 +1920,8 @@ typedef struct CPUArchState {
>       uint32_t cpuid_vendor3;
>       uint32_t cpuid_version;
>       FeatureWordArray features;
> +    /* AVX10 version */
> +    uint8_t avx10_version;
>       /* Features that were explicitly enabled/disabled */
>       FeatureWordArray user_features;
>       uint32_t cpuid_model[12];
Re: [PATCH 2/6] target/i386: add avx10-version property
Posted by Tao Su 3 weeks, 4 days ago
On Mon, Oct 28, 2024 at 11:10:45PM +0800, Xiaoyao Li wrote:
> On 10/28/2024 10:45 AM, Tao Su wrote:
> > Introduce avx10-version property so that avx10 version can be controlled
> > by user and cpu model. Per spec, avx10 version can never be 0, the default
> > value of avx10-version is set to 0 to determine whether it is specified by
> > user.
> 
> I think it's better to merge this patch into next one. It's intact to show
> how avx10_version is supposed to work.
> 

Will do in v2, thanks for this suggestion!