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....@intel.com>
Signed-off-by: Tao Su <tao1...@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];


Reply via email to