aboutsummaryrefslogtreecommitdiff
path: root/hw/i386/x86.c
diff options
context:
space:
mode:
authorZhao Liu <zhao1.liu@intel.com>2024-04-24 23:49:23 +0800
committerPaolo Bonzini <pbonzini@redhat.com>2024-05-22 19:43:29 +0200
commitb17a26bc4b0289ca7415f821bb0a89a8a333cea5 (patch)
tree03f0cf09237244fb115766dbac28d1042e3eb28b /hw/i386/x86.c
parent5304873acd12f7a4ddb07d3560ac5ac02a0e1060 (diff)
i386: Support module_id in X86CPUTopoIDs
Add module_id member in X86CPUTopoIDs. module_id can be parsed from APIC ID, so also update APIC ID parsing rule to support module level. With this support, the conversions with module level between X86CPUTopoIDs, X86CPUTopoInfo and APIC ID are completed. module_id can be also generated from cpu topology, and before i386 supports "modules" in smp, the default "modules per die" (modules * clusters) is only 1, thus the module_id generated in this way is 0, so that it will not conflict with the module_id generated by APIC ID. Tested-by: Yongwei Ma <yongwei.ma@intel.com> Signed-off-by: Zhuocheng Ding <zhuocheng.ding@intel.com> Co-developed-by: Zhuocheng Ding <zhuocheng.ding@intel.com> Signed-off-by: Zhao Liu <zhao1.liu@intel.com> Tested-by: Babu Moger <babu.moger@amd.com> Message-ID: <20240424154929.1487382-16-zhao1.liu@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/i386/x86.c')
-rw-r--r--hw/i386/x86.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/i386/x86.c b/hw/i386/x86.c
index d5d668e814..a4aa8e0810 100644
--- a/hw/i386/x86.c
+++ b/hw/i386/x86.c
@@ -135,6 +135,10 @@ static const CPUArchIdList *x86_possible_cpu_arch_ids(MachineState *ms)
ms->possible_cpus->cpus[i].props.has_die_id = true;
ms->possible_cpus->cpus[i].props.die_id = topo_ids.die_id;
}
+ if (ms->smp.modules > 1) {
+ ms->possible_cpus->cpus[i].props.has_module_id = true;
+ ms->possible_cpus->cpus[i].props.module_id = topo_ids.module_id;
+ }
ms->possible_cpus->cpus[i].props.has_core_id = true;
ms->possible_cpus->cpus[i].props.core_id = topo_ids.core_id;
ms->possible_cpus->cpus[i].props.has_thread_id = true;