aboutsummaryrefslogtreecommitdiff
path: root/include/hw/i386
diff options
context:
space:
mode:
authorZhao Liu <zhao1.liu@intel.com>2024-04-24 23:49:22 +0800
committerPaolo Bonzini <pbonzini@redhat.com>2024-05-22 19:43:29 +0200
commit5304873acd12f7a4ddb07d3560ac5ac02a0e1060 (patch)
tree49b580cd9700dbbc9cecfa41a0697ea840b7e966 /include/hw/i386
parent3568adc995b3906b5cc134753a829363f08bf6e1 (diff)
downloadqemu-5304873acd12f7a4ddb07d3560ac5ac02a0e1060.zip
qemu-5304873acd12f7a4ddb07d3560ac5ac02a0e1060.tar.gz
qemu-5304873acd12f7a4ddb07d3560ac5ac02a0e1060.tar.bz2
i386: Expose module level in CPUID[0x1F]
Linux kernel (from v6.4, with commit edc0a2b595765 ("x86/topology: Fix erroneous smp_num_siblings on Intel Hybrid platforms") is able to handle platforms with Module level enumerated via CPUID.1F. Expose the module level in CPUID[0x1F] if the machine has more than 1 modules. Tested-by: Yongwei Ma <yongwei.ma@intel.com> Signed-off-by: Zhao Liu <zhao1.liu@intel.com> Tested-by: Babu Moger <babu.moger@amd.com> Message-ID: <20240424154929.1487382-15-zhao1.liu@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include/hw/i386')
-rw-r--r--include/hw/i386/topology.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/hw/i386/topology.h b/include/hw/i386/topology.h
index 7622d80..ea87104 100644
--- a/include/hw/i386/topology.h
+++ b/include/hw/i386/topology.h
@@ -71,6 +71,7 @@ enum CPUTopoLevel {
CPU_TOPO_LEVEL_INVALID,
CPU_TOPO_LEVEL_SMT,
CPU_TOPO_LEVEL_CORE,
+ CPU_TOPO_LEVEL_MODULE,
CPU_TOPO_LEVEL_DIE,
CPU_TOPO_LEVEL_PACKAGE,
CPU_TOPO_LEVEL_MAX,
@@ -198,11 +199,12 @@ static inline apic_id_t x86_apicid_from_cpu_idx(X86CPUTopoInfo *topo_info,
}
/*
- * Check whether there's extended topology level (die)?
+ * Check whether there's extended topology level (module or die)?
*/
static inline bool x86_has_extended_topo(unsigned long *topo_bitmap)
{
- return test_bit(CPU_TOPO_LEVEL_DIE, topo_bitmap);
+ return test_bit(CPU_TOPO_LEVEL_MODULE, topo_bitmap) ||
+ test_bit(CPU_TOPO_LEVEL_DIE, topo_bitmap);
}
#endif /* HW_I386_TOPOLOGY_H */