[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC 41/41] hw/i386: Cleanup non-QOM topology support
From: |
Zhao Liu |
Subject: |
[RFC 41/41] hw/i386: Cleanup non-QOM topology support |
Date: |
Thu, 30 Nov 2023 22:42:03 +0800 |
From: Zhao Liu <zhao1.liu@intel.com>
After i386 supports QOM topology, drop original topology logic.
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
---
hw/i386/x86.c | 52 +++++++++++----------------------------------------
1 file changed, 11 insertions(+), 41 deletions(-)
diff --git a/hw/i386/x86.c b/hw/i386/x86.c
index 99f6c502de43..cba8b806cdb6 100644
--- a/hw/i386/x86.c
+++ b/hw/i386/x86.c
@@ -118,7 +118,8 @@ out:
void x86_cpus_init(X86MachineState *x86ms, int default_cpu_version)
{
- int i;
+ CPUCore *core;
+ int i, cpu_index = 0, core_idx = 0;
const CPUArchIdList *possible_cpus;
MachineState *ms = MACHINE(x86ms);
MachineClass *mc = MACHINE_GET_CLASS(x86ms);
@@ -153,34 +154,17 @@ void x86_cpus_init(X86MachineState *x86ms, int
default_cpu_version)
possible_cpus = mc->possible_cpu_arch_ids(ms);
- /*
- * possible_cpus_qom_granu means the QOM topology support.
- *
- * TODO: Drop the "!mc->smp_props.possible_cpus_qom_granu" case when
- * i386 completes QOM topology support.
- */
- if (mc->smp_props.possible_cpus_qom_granu) {
- CPUCore *core;
- int cpu_index = 0;
- int core_idx = 0;
-
- MACHINE_CORE_FOREACH(ms, core) {
- for (i = 0; i < core->plugged_threads; i++) {
- x86_cpu_new(x86ms, possible_cpus->cpus[cpu_index].arch_id,
- OBJECT(core), cpu_index, &error_fatal);
- cpu_index++;
- }
-
- if (core->plugged_threads < core->nr_threads) {
- cpu_index += core->nr_threads - core->plugged_threads;
- }
- core_idx++;
+ MACHINE_CORE_FOREACH(ms, core) {
+ for (i = 0; i < core->plugged_threads; i++) {
+ x86_cpu_new(x86ms, possible_cpus->cpus[cpu_index].arch_id,
+ OBJECT(core), cpu_index, &error_fatal);
+ cpu_index++;
}
- } else {
- for (i = 0; i < ms->smp.cpus; i++) {
- x86_cpu_new(x86ms, possible_cpus->cpus[i].arch_id,
- NULL, i, &error_fatal);
+
+ if (core->plugged_threads < core->nr_threads) {
+ cpu_index += core->nr_threads - core->plugged_threads;
}
+ core_idx++;
}
}
@@ -460,20 +444,6 @@ void x86_cpu_pre_plug(HotplugHandler *hotplug_dev,
return;
}
- /*
- * possible_cpus_qom_granu means the QOM topology support.
- *
- * TODO: Drop the "!mc->smp_props.possible_cpus_qom_granu" case when
- * i386 completes QOM topology support.
- */
- if (!mc->smp_props.possible_cpus_qom_granu) {
- x86_topo_ids_from_apicid(cpu->apic_id, &topo_info, &topo_ids);
- x86_cpu_assign_topo_id(cpu, &topo_ids, errp);
- if (*errp) {
- return;
- }
- }
-
if (hyperv_feat_enabled(cpu, HYPERV_FEAT_VPINDEX) &&
kvm_enabled() && !kvm_hv_vpindex_settable()) {
error_setg(errp, "kernel doesn't allow setting HyperV VP_INDEX");
--
2.34.1
- [RFC 32/41] hw/machine: Build smp topology tree from -smp, (continued)
- [RFC 32/41] hw/machine: Build smp topology tree from -smp, Zhao Liu, 2023/11/30
- [RFC 33/41] hw/machine: Validate smp topology tree without -smp, Zhao Liu, 2023/11/30
- [RFC 31/41] hw/machine: Plug cpu-slot into machine to maintain topology tree, Zhao Liu, 2023/11/30
- [RFC 34/41] hw/core/topo: Implement user-child to collect topology device from cli, Zhao Liu, 2023/11/30
- [RFC 35/41] hw/i386: Make x86_cpu_new() private in x86.c, Zhao Liu, 2023/11/30
- [RFC 38/41] hw/i386: Wrap apic id and topology sub ids assigning as helpers, Zhao Liu, 2023/11/30
- [RFC 36/41] hw/i386: Allow x86_cpu_new() to specify parent for new CPU, Zhao Liu, 2023/11/30
- [RFC 40/41] hw/i386: Support QOM topology, Zhao Liu, 2023/11/30
- [RFC 39/41] hw/i386: Add the interface to search parent for QOM topology, Zhao Liu, 2023/11/30
- [RFC 37/41] hw/i386: Allow i386 to create new CPUs from QOM topology, Zhao Liu, 2023/11/30
- [RFC 41/41] hw/i386: Cleanup non-QOM topology support,
Zhao Liu <=