[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 05/10] hw/arm/virt: Support cluster level in DT cpu-map
From: |
Yanan Wang |
Subject: |
[PATCH v4 05/10] hw/arm/virt: Support cluster level in DT cpu-map |
Date: |
Sun, 21 Nov 2021 20:24:57 +0800 |
Support one cluster level between core and physical package in the
cpu-map of Arm/virt devicetree. This is also consistent with Linux
Doc "Documentation/devicetree/bindings/cpu/cpu-topology.txt".
Signed-off-by: Yanan Wang <wangyanan55@huawei.com>
---
hw/arm/virt.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index b2129f7ccd..dfdc64c4e3 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -430,9 +430,8 @@ static void fdt_add_cpu_nodes(const VirtMachineState *vms)
* can contain several layers of clustering within a single physical
* package and cluster nodes can be contained in parent cluster nodes.
*
- * Given that cluster is not yet supported in the vCPU topology,
- * we currently generate one cluster node within each socket node
- * by default.
+ * Note: currently we only support one layer of clustering within
+ * each physical package.
*/
qemu_fdt_add_subnode(ms->fdt, "/cpus/cpu-map");
@@ -442,14 +441,16 @@ static void fdt_add_cpu_nodes(const VirtMachineState *vms)
if (ms->smp.threads > 1) {
map_path = g_strdup_printf(
- "/cpus/cpu-map/socket%d/cluster0/core%d/thread%d",
- cpu / (ms->smp.cores * ms->smp.threads),
+ "/cpus/cpu-map/socket%d/cluster%d/core%d/thread%d",
+ cpu / (ms->smp.clusters * ms->smp.cores * ms->smp.threads),
+ (cpu / (ms->smp.cores * ms->smp.threads)) %
ms->smp.clusters,
(cpu / ms->smp.threads) % ms->smp.cores,
cpu % ms->smp.threads);
} else {
map_path = g_strdup_printf(
- "/cpus/cpu-map/socket%d/cluster0/core%d",
- cpu / ms->smp.cores,
+ "/cpus/cpu-map/socket%d/cluster%d/core%d",
+ cpu / (ms->smp.clusters * ms->smp.cores),
+ (cpu / ms->smp.cores) % ms->smp.clusters,
cpu % ms->smp.cores);
}
qemu_fdt_add_path(ms->fdt, map_path);
--
2.19.1
- [PATCH v4 00/10] ARM virt: Introduce CPU clusters topology support, Yanan Wang, 2021/11/21
- [PATCH v4 04/10] hw/arm/virt: Support clusters on ARM virt machines, Yanan Wang, 2021/11/21
- [PATCH v4 07/10] hw/arm/virt-acpi-build: Make an ARM specific PPTT generator, Yanan Wang, 2021/11/21
- [PATCH v4 06/10] hw/acpi/aml-build: Improve scalability of PPTT generation, Yanan Wang, 2021/11/21
- [PATCH v4 05/10] hw/arm/virt: Support cluster level in DT cpu-map,
Yanan Wang <=
- [PATCH v4 02/10] hw/core/machine: Introduce CPU cluster topology support, Yanan Wang, 2021/11/21
- [PATCH v4 01/10] qemu-options: Improve readability of SMP related Docs, Yanan Wang, 2021/11/21
- [PATCH v4 10/10] tests/acpi/bios-table-test: Update expected virt/PPTT file, Yanan Wang, 2021/11/21
- [PATCH v4 03/10] hw/core/machine: Wrap target specific parameters together, Yanan Wang, 2021/11/21
- [PATCH v4 08/10] tests/acpi/bios-tables-test: Allow changes to virt/PPTT file, Yanan Wang, 2021/11/21
- [PATCH v4 09/10] hw/acpi/virt-acpi-build: Support cluster level in PPTT generation, Yanan Wang, 2021/11/21