Skip to contentSkip to conversation

i386/cpu: miscellaneous fixes for DiamondRapids

PATCH In review Zhao Liu 1 participant 5 messages Sep 30 – Nov 20

lore
Share & tools
lore

Zhao Liu

author
#0 lore raw

cover i386/cpu: miscellaneous fixes for DiamondRapids

Hi,

This series includes:
* AVX10.2 feature renaming to keep up with the latest spec changes.
* A fix for DMR cache topology emulation.

In addition, there is another TF32 fix remaining in the mail list, which is a change in hardware implementation:

https://lore.kernel.org/qemu-devel/[email protected]/

Thanks and Best Regards,
Zhao
---
Zhao Liu (3):
i386/cpu: rename feature name avx10-vnni-int to avx10-v1-aux i386/cpu: rename CPUID_24_1_ECX_AVX10_VNNI_INT macro to

    CPUID_24_1_ECX_AVX10_V1_AUX

hw/core/machine-smp: allow thread level cache

 hw/core/machine-smp.c | 7 -------
 target/i386/cpu.c     | 7 ++++---
 target/i386/cpu.h     | 4 ++--
 3 files changed, 6 insertions(+), 12 deletions(-)
Signature · 1 line
2.34.1
author
#1 lore raw

PATCH 1/3 i386/cpu: rename feature name avx10-vnni-int to avx10-v1-aux

Since the AVX10.2 Spec rev. 6.0, CPUID feature bit AVX10_VNNI_INT is renamed to AVX10_V1_AUX to cover additional more convert instructions:
VCVT[,2]PH2[B,H]F8[,S], VCVT2PS2PHX,VCVTBIASPH2[B,H]F8[,S], VCVTHF82PH.

Therefore, rename the feature name to avx10-v1-aux and use the old name avx10-vnni-int as an alias for compatibility.

---
 target/i386/cpu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
target/i386/cpu.c +2 -1
index f3bc6911c10f..e1c012cf2dfa 100644
@@ -1370,7 +1370,7 @@ FeatureWordInfo feature_word_info[FEATURE_WORDS] = {
     [FEAT_24_1_ECX] = {
         .type = CPUID_FEATURE_WORD,
         .feat_names = {
-            [2] = "avx10-vnni-int",
+            [2] = "avx10-v1-aux",
         },
         .cpuid = {
             .eax = 0x24,
@@ -10556,6 +10556,7 @@ static void x86_cpu_initfn(Object *obj)
     object_property_add_alias(obj, "hv-apicv", obj, "hv-avic");
     cpu->lbr_fmt = ~PERF_CAP_LBR_FMT;
     object_property_add_alias(obj, "lbr_fmt", obj, "lbr-fmt");
+    object_property_add_alias(obj, "avx10-vnni-int", obj, "avx10-v1-aux");
 
     if (xcc->model) {
         x86_cpu_load_model(cpu, xcc->model);
Signature · 1 line
2.34.1
author
#2 lore raw

PATCH 2/3 i386/cpu: rename CPUID_24_1_ECX_AVX10_VNNI_INT macro to CPUID_24_1_ECX_AVX10_V1_AUX

In reply to Zhao Liu

Use CPUID_24_1_ECX_AVX10_V1_AUX macro to align with the official feature name in AVX10.2 (since AVX10.2 spec rev 6.0).

---
 target/i386/cpu.c | 4 ++--
 target/i386/cpu.h | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
target/i386/cpu.c +2 -2
index e1c012cf2dfa..6f27c2e7b00b 100644
@@ -2395,7 +2395,7 @@ static const AVX10VersionDefinition builtin_avx10_defs[] = {
         .version = 2,
         .max_subleaf = 1,
         .features = (FeatureMask[]) {
-            { FEAT_24_1_ECX,         CPUID_24_1_ECX_AVX10_VNNI_INT },
+            { FEAT_24_1_ECX,         CPUID_24_1_ECX_AVX10_V1_AUX },
             { /* end of list */ }
         }
     },
@@ -5733,7 +5733,7 @@ static const X86CPUDefinition builtin_x86_defs[] = {
          * Though this bit will be set by avx_version=2, it's better to
          * explicitly enumerate this feature here.
          */
-        .features[FEAT_24_1_ECX] = CPUID_24_1_ECX_AVX10_VNNI_INT,
+        .features[FEAT_24_1_ECX] = CPUID_24_1_ECX_AVX10_V1_AUX,
         .features[FEAT_8000_0001_ECX] =
             CPUID_EXT3_LAHF_LM | CPUID_EXT3_ABM | CPUID_EXT3_3DNOWPREFETCH,
         .features[FEAT_8000_0001_EDX] =
target/i386/cpu.h +2 -2
index 786957fadd08..771673d0902a 100644
@@ -1136,8 +1136,8 @@ uint64_t x86_cpu_get_supported_feature_word(X86CPU *cpu, FeatureWord w);
                                          CPUID_24_0_EBX_AVX10_256 | \
                                          CPUID_24_0_EBX_AVX10_512)
 
-/* AVX10_VNNI_INT instruction */
-#define CPUID_24_1_ECX_AVX10_VNNI_INT         (1U << 2)
+/* AVX10_V1_AUX instruction */
+#define CPUID_24_1_ECX_AVX10_V1_AUX           (1U << 2)
 
 /*
  * New Conditional Instructions (NCIs), explicit New Data Destination (NDD)
Signature · 1 line
2.34.1
author
#3 lore raw

PATCH 3/3 hw/core/machine-smp: allow thread level cache

In reply to Zhao Liu

Commit 87ae7ab84fff allowed i386 CPU to configure thread level cache, However, without support for the cache model, users still need to configure it through -machine smp-cache.

Remove the thread-level restriction in the smp-cache option.

Fixes commit 87ae7ab84fff ("i386/cpu: Allow cache to be shared at thread level")
---
 hw/core/machine-smp.c | 7 -------
 1 file changed, 7 deletions(-)
hw/core/machine-smp.c +0 -7
index bef04aa2d713..baf06bca2aeb 100644
@@ -321,13 +321,6 @@ bool machine_parse_smp_cache(MachineState *ms,
             return false;
         }
 
-        if (props->topology == CPU_TOPOLOGY_LEVEL_THREAD) {
-            error_setg(errp,
-                       "%s level cache not supported by this machine",
-                       CpuTopologyLevel_str(props->topology));
-            return false;
-        }
-
         if (!machine_check_topo_support(ms, props->topology, errp)) {
             return false;
         }
Signature · 1 line
2.34.1
author
#4 lore raw
In reply to Zhao Liu

Hi maintainers,

Just a gentle ping.

Regards,
Zhao

Quoted 33 lines · Zhao Liu

Date: Wed, 30 Sep 2026 12:52:34 +0800
From: Zhao Liu <[email protected]>
Subject: [PATCH 0/3] i386/cpu: miscellaneous fixes for DiamondRapids
X-Mailer: git-send-email 2.34.1

Hi,

This series includes:
* AVX10.2 feature renaming to keep up with the latest spec changes.
* A fix for DMR cache topology emulation.

In addition, there is another TF32 fix remaining in the mail list, which is a change in hardware implementation:

https://lore.kernel.org/qemu-devel/[email protected]/

Thanks and Best Regards,
Zhao
---
Zhao Liu (3):
i386/cpu: rename feature name avx10-vnni-int to avx10-v1-aux i386/cpu: rename CPUID_24_1_ECX_AVX10_VNNI_INT macro to

    CPUID_24_1_ECX_AVX10_V1_AUX

hw/core/machine-smp: allow thread level cache

 hw/core/machine-smp.c | 7 -------
 target/i386/cpu.c     | 7 ++++---
 target/i386/cpu.h     | 4 ++--
 3 files changed, 6 insertions(+), 12 deletions(-)
Signature · 1 line
2.34.1