[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH v2 4/4] hw/arm/virt: Add cluster level for device tree
From: |
Andrew Jones |
Subject: |
Re: [RFC PATCH v2 4/4] hw/arm/virt: Add cluster level for device tree |
Date: |
Wed, 28 Apr 2021 12:46:05 +0200 |
On Tue, Apr 13, 2021 at 04:31:47PM +0800, Yanan Wang wrote:
> 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 | 12 ++++++++----
> 1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/hw/arm/virt.c b/hw/arm/virt.c
> index 51797628db..4468a4734b 100644
> --- a/hw/arm/virt.c
> +++ b/hw/arm/virt.c
> @@ -434,14 +434,18 @@ 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 / (vms->smp_clusters * ms->smp.cores *
> + ms->smp.threads),
> + "cluster", (cpu / (ms->smp.cores * ms->smp.threads)) %
> + vms->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 / (vms->smp_clusters * ms->smp.cores),
> + "cluster", (cpu / ms->smp.cores) % vms->smp_clusters,
> "core", cpu % ms->smp.cores);
> }
> qemu_fdt_add_path(ms->fdt, map_path);
> --
> 2.19.1
>
Reviewed-by: Andrew Jones <drjones@redhat.com>
- [RFC PATCH v2 0/4] hw/arm/virt: Introduce cluster cpu topology support, Yanan Wang, 2021/04/13
- [RFC PATCH v2 4/4] hw/arm/virt: Add cluster level for device tree, Yanan Wang, 2021/04/13
- Re: [RFC PATCH v2 4/4] hw/arm/virt: Add cluster level for device tree,
Andrew Jones <=
- [RFC PATCH v2 3/4] hw/arm/virt-acpi-build: Add cluster level for PPTT table, Yanan Wang, 2021/04/13
- [RFC PATCH v2 1/4] vl.c: Add -smp, clusters=* command line support for ARM cpu, Yanan Wang, 2021/04/13
- [RFC PATCH v2 2/4] hw/arm/virt: Parse -smp cluster parameter in virt_smp_parse, Yanan Wang, 2021/04/13