[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC 36/52] i386: Use init_apicid_topo_info() to initialize APIC ID topo
From: |
Zhao Liu |
Subject: |
[RFC 36/52] i386: Use init_apicid_topo_info() to initialize APIC ID topology for system emulator |
Date: |
Mon, 13 Feb 2023 17:50:19 +0800 |
From: Zhao Liu <zhao1.liu@intel.com>
Since APIC ID for hybrid CPU topology needs to consider maximum possible
structures for each topology levels, the APIC IDs for hybrid CPU topology
and smp CPU topology may be different.
User emulator doesn't support hybrid CPU topology so use
init_apicid_topo_info() for system emulator.
Co-Developed-by: Zhuocheng Ding <zhuocheng.ding@intel.com>
Signed-off-by: Zhuocheng Ding <zhuocheng.ding@intel.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
---
target/i386/cpu.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 844b6df63a4a..7d6722ab3292 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -39,6 +39,7 @@
#include "exec/address-spaces.h"
#include "hw/boards.h"
#include "hw/i386/sgx-epc.h"
+#include "hw/i386/x86.h"
#endif
#include "disas/capstone.h"
@@ -5260,10 +5261,15 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index,
uint32_t count,
uint32_t signature[3];
X86ApicidTopoInfo apicid_topo;
+#ifndef CONFIG_USER_ONLY
+ X86MachineState *x86ms = X86_MACHINE(qdev_get_machine());
+ init_apicid_topo_info(&apicid_topo, x86ms);
+#else
apicid_topo.max_dies = cs->topo.dies_per_socket;
apicid_topo.max_modules = cs->topo.clusters_per_die;
apicid_topo.max_cores = cs->topo.cores_per_cluster;
apicid_topo.max_threads = cs->topo.threads_per_core;
+#endif
/* Calculate & apply limits for different index ranges */
if (index >= 0xC0000000) {
--
2.34.1
- [RFC 31/52] i386/cpu: Use CPUState.topo to replace X86CPUTopoInfo to get topology info, (continued)
- [RFC 31/52] i386/cpu: Use CPUState.topo to replace X86CPUTopoInfo to get topology info, Zhao Liu, 2023/02/13
- [RFC 32/52] i386: Rename X86CPUTopoInfo and its members to reflect relationship with APIC ID, Zhao Liu, 2023/02/13
- [RFC 35/52] i386: Support APIC ID topology for hybrid CPU topology, Zhao Liu, 2023/02/13
- [RFC 33/52] i386: Rename init_topo_info() to init_apic_topo_info(), Zhao Liu, 2023/02/13
- [RFC 34/52] i386: Rename variable topo_info to apicid_topo, Zhao Liu, 2023/02/13
- [RFC 36/52] i386: Use init_apicid_topo_info() to initialize APIC ID topology for system emulator,
Zhao Liu <=
- [RFC 38/52] i386: Introduce hybrid_core_type to CPUX86State, Zhao Liu, 2023/02/13
- [RFC 37/52] i386: Update X86CPUTopoIDs generating rule for hybrid topology, Zhao Liu, 2023/02/13
- [RFC 41/52] machine: Introduce core_type() hook, Zhao Liu, 2023/02/13