*edx = 0;
}
break;
- case 0x8000001D:
+ case 0x8000001D: {
+ const CPUCaches *caches;
+
+ /*
+ * FIXME: Temporarily select cache info model here based on
+ * vendor, and merge these 2 cache info models later.
+ *
+ * Intel doesn't support this leaf so that Intel Guests don't
+ * have this leaf. This change is harmless to Intel CPUs.
+ */
+ if (IS_AMD_CPU(env)) {
+ caches = &env->cache_info_amd;
+ } else {
+ caches = &env->cache_info_cpuid4;
+ }
+
*eax = 0;
if (cpu->cache_info_passthrough) {
x86_cpu_get_cache_cpuid(index, count, eax, ebx, ecx, edx);
}
switch (count) {
case 0: /* L1 dcache info */
- encode_cache_cpuid8000001d(env->cache_info_amd.l1d_cache,
+ encode_cache_cpuid8000001d(caches->l1d_cache,
topo_info, eax, ebx, ecx, edx);
break;
case 1: /* L1 icache info */
- encode_cache_cpuid8000001d(env->cache_info_amd.l1i_cache,
+ encode_cache_cpuid8000001d(caches->l1i_cache,
topo_info, eax, ebx, ecx, edx);
break;
case 2: /* L2 cache info */
- encode_cache_cpuid8000001d(env->cache_info_amd.l2_cache,
+ encode_cache_cpuid8000001d(caches->l2_cache,
topo_info, eax, ebx, ecx, edx);
break;
case 3: /* L3 cache info */
- encode_cache_cpuid8000001d(env->cache_info_amd.l3_cache,
+ encode_cache_cpuid8000001d(caches->l3_cache,
topo_info, eax, ebx, ecx, edx);
break;
default: /* end of info */
*edx &= CACHE_NO_INVD_SHARING | CACHE_INCLUSIVE;
}
break;
+ }
case 0x8000001E:
if (cpu->core_id <= 255) {
encode_topo_cpuid8000001e(cpu, topo_info, eax, ebx, ecx, edx);