From: Tina Zhang When legacy-cache=on, x86_cpu_realizefn() builds a hardcoded cache model. It selected the AMD legacy cache table only for CPUs with the AuthenticAMD vendor ID. Dhyana uses the HygonGenuine vendor ID, so this explicit compatibility path fell back to QEMU's old Intel legacy cache table. The wrong table is visible through AMD extended cache leaves. With the Intel legacy table, Dhyana reports 32 KiB, 8-way L1 caches in CPUID 0x80000005 and a 4 MiB, 16-way L2 cache in CPUID 0x80000006. Linux uses the AMD/Hygon cache enumeration path for Hygon and reads these AMD extended cache leaves. Use the AMD legacy cache table for Hygon in this fallback path when the new Hygon vendor ABI fixes are enabled. Keep the old fallback for pc-11.0 and older machine types through x-hygon-vendor-abi-fixes=false. The default Dhyana model is unchanged because it provides EPYC cache_info and therefore defaults legacy-cache to off. The guest-visible change is limited to users who explicitly configure legacy-cache=on on new machine types. Signed-off-by: Tina Zhang --- target/i386/cpu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 47f48f4a96..279c9b3ae7 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -10342,7 +10342,8 @@ static void x86_cpu_realizefn(DeviceState *dev, Error **errp) env->enable_legacy_vendor_cache = true; } - if (IS_AMD_CPU(env)) { + if (IS_AMD_CPU(env) || + (IS_HYGON_CPU(env) && cpu->hygon_vendor_abi_fixes)) { env->cache_info = legacy_amd_cache_info; } else { env->cache_info = legacy_intel_cache_info; -- 2.43.7