From: Andrew Jones <drjones@redhat.com>
To: Yanan Wang <wangyanan55@huawei.com>
Cc: Barry Song <song.bao.hua@hisilicon.com>,
Peter Maydell <peter.maydell@linaro.org>,
"Michael S . Tsirkin" <mst@redhat.com>,
wanghaibin.wang@huawei.com, qemu-devel@nongnu.org,
yangyicong@huawei.com, Shannon Zhao <shannon.zhaosl@gmail.com>,
qemu-arm@nongnu.org, Alistair Francis <alistair.francis@wdc.com>,
prime.zeng@hisilicon.com, Igor Mammedov <imammedo@redhat.com>,
yuzenghui@huawei.com, Paolo Bonzini <pbonzini@redhat.com>,
zhukeqian1@huawei.com, Jiajie Li <lijiajie11@huawei.com>,
David Gibson <david@gibson.dropbear.id.au>
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 [thread overview]
Message-ID: <20210428104605.nt7274cduqjk376g@gator> (raw)
In-Reply-To: <20210413083147.34236-5-wangyanan55@huawei.com>
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>
prev parent reply other threads:[~2021-04-28 10:48 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-13 8:31 [RFC PATCH v2 0/4] hw/arm/virt: Introduce cluster cpu topology support Yanan Wang
2021-04-13 8:31 ` [RFC PATCH v2 1/4] vl.c: Add -smp, clusters=* command line support for ARM cpu Yanan Wang
2021-04-28 10:23 ` Andrew Jones
2021-04-29 1:22 ` wangyanan (Y)
2021-04-13 8:31 ` [RFC PATCH v2 2/4] hw/arm/virt: Parse -smp cluster parameter in virt_smp_parse Yanan Wang
2021-04-28 10:31 ` Andrew Jones
2021-04-29 2:14 ` wangyanan (Y)
2021-04-29 7:16 ` Andrew Jones
2021-04-29 8:56 ` wangyanan (Y)
2021-04-29 11:02 ` Andrew Jones
2021-04-30 5:09 ` wangyanan (Y)
2021-04-30 6:41 ` Andrew Jones
2021-04-30 7:01 ` Andrew Jones
2021-04-30 9:33 ` wangyanan (Y)
2021-04-30 10:49 ` Andrew Jones
2021-05-06 7:04 ` wangyanan (Y)
2021-04-30 8:59 ` wangyanan (Y)
2021-04-30 10:48 ` Andrew Jones
2021-04-13 8:31 ` [RFC PATCH v2 3/4] hw/arm/virt-acpi-build: Add cluster level for PPTT table Yanan Wang
2021-04-28 10:41 ` Andrew Jones
2021-04-13 8:31 ` [RFC PATCH v2 4/4] hw/arm/virt: Add cluster level for device tree Yanan Wang
2021-04-28 10:46 ` Andrew Jones [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210428104605.nt7274cduqjk376g@gator \
--to=drjones@redhat.com \
--cc=alistair.francis@wdc.com \
--cc=david@gibson.dropbear.id.au \
--cc=imammedo@redhat.com \
--cc=lijiajie11@huawei.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=prime.zeng@hisilicon.com \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=shannon.zhaosl@gmail.com \
--cc=song.bao.hua@hisilicon.com \
--cc=wanghaibin.wang@huawei.com \
--cc=wangyanan55@huawei.com \
--cc=yangyicong@huawei.com \
--cc=yuzenghui@huawei.com \
--cc=zhukeqian1@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).