[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 6/6] hw/arm/virt: Add cluster level for ARM device tree
From: |
Yanan Wang |
Subject: |
[RFC PATCH 6/6] hw/arm/virt: Add cluster level for ARM device tree |
Date: |
Wed, 31 Mar 2021 17:53:43 +0800 |
Add a cluster level between core level and package level for
ARM device tree.
Signed-off-by: Yanan Wang <wangyanan55@huawei.com>
---
hw/arm/virt.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index c9ad76ff64..d78db3387e 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -430,14 +430,20 @@ static void fdt_add_cpu_nodes(const VirtMachineState *vms)
if (ms->smp.threads > 1) {
map_path = g_strdup_printf(
- "/cpus/cpu-map/%s%d/%s%d/%s%d",
- "socket", cpu / (ms->smp.cores * ms->smp.threads),
+ "/cpus/cpu-map/%s%d/%s%d/%s%d/%s%d",
+ "socket",
+ cpu / (ms->smp.clusters * ms->smp.cores *
+ ms->smp.threads),
+ "cluster",
+ (cpu / (ms->smp.cores * ms->smp.threads)) %
+ ms->smp.clusters,
"core", (cpu / ms->smp.threads) % ms->smp.cores,
"thread", cpu % ms->smp.threads);
} else {
map_path = g_strdup_printf(
- "/cpus/cpu-map/%s%d/%s%d",
- "socket", cpu / ms->smp.cores,
+ "/cpus/cpu-map/%s%d/%s%d/%s%d",
+ "socket", cpu / (ms->smp.clusters * ms->smp.cores),
+ "cluster", (cpu / ms->smp.cores) %
ms->smp.clusters,
"core", cpu % ms->smp.cores);
}
qemu_fdt_add_path(vms->fdt, map_path);
--
2.19.1
- [RFC PATCH 0/6] Introduce cluster cpu topology support, Yanan Wang, 2021/03/31
- [RFC PATCH 5/6] hw/arm/virt-acpi-build: Add cluster level for ARM PPTT table, Yanan Wang, 2021/03/31
- [RFC PATCH 1/6] vl.c: Add arch-neutral -smp, clusters=* command line support, Yanan Wang, 2021/03/31
- [RFC PATCH 3/6] hw/arm/virt: Parse cluster cpu topology for ARM machines, Yanan Wang, 2021/03/31
- [RFC PATCH 6/6] hw/arm/virt: Add cluster level for ARM device tree,
Yanan Wang <=
- [RFC PATCH 2/6] hw/core/machine: Parse cluster cpu topology in smp_parse(), Yanan Wang, 2021/03/31
- [RFC PATCH 4/6] hw/i386/pc: Parse cluster cpu topology for PC machines, Yanan Wang, 2021/03/31
- Re: [RFC PATCH 0/6] Introduce cluster cpu topology support, Paolo Bonzini, 2021/03/31