From: Yanan Wang <wangyanan55@huawei.com>
To: Peter Maydell <peter.maydell@linaro.org>,
Paolo Bonzini <pbonzini@redhat.com>,
Andrew Jones <drjones@redhat.com>,
"Michael S . Tsirkin" <mst@redhat.com>,
Igor Mammedov <imammedo@redhat.com>,
Shannon Zhao <shannon.zhaosl@gmail.com>, <qemu-devel@nongnu.org>,
<qemu-arm@nongnu.org>
Cc: "Barry Song" <song.bao.hua@hisilicon.com>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>,
"Yanan Wang" <wangyanan55@huawei.com>,
prime.zeng@hisilicon.com, wanghaibin.wang@huawei.com,
yuzenghui@huawei.com, yangyicong@huawei.com,
zhukeqian1@huawei.com
Subject: [RFC PATCH v3 3/4] hw/arm/virt-acpi-build: Add cluster level to PPTT table
Date: Sun, 16 May 2021 18:32:27 +0800 [thread overview]
Message-ID: <20210516103228.37792-4-wangyanan55@huawei.com> (raw)
In-Reply-To: <20210516103228.37792-1-wangyanan55@huawei.com>
Add a Processor Hierarchy Node of cluster level between core level
and socket level to ARM PPTT table.
Reviewed-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Yanan Wang <wangyanan55@huawei.com>
---
hw/arm/virt-acpi-build.c | 45 ++++++++++++++++++++++++----------------
1 file changed, 27 insertions(+), 18 deletions(-)
diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
index b03d57745a..4d09b51bb0 100644
--- a/hw/arm/virt-acpi-build.c
+++ b/hw/arm/virt-acpi-build.c
@@ -447,34 +447,43 @@ static void build_pptt(GArray *table_data, BIOSLinker *linker,
for (socket = 0; socket < ms->smp.sockets; socket++) {
uint32_t socket_offset = table_data->len - pptt_start;
- int core;
+ int cluster;
build_processor_hierarchy_node(
table_data,
(1 << 0), /* ACPI 6.2 - Physical package */
0, socket, NULL, 0);
- for (core = 0; core < ms->smp.cores; core++) {
- uint32_t core_offset = table_data->len - pptt_start;
- int thread;
-
- if (ms->smp.threads <= 1) {
- build_processor_hierarchy_node(
- table_data,
- (1 << 1) | /* ACPI 6.2 - ACPI Processor ID valid */
- (1 << 3), /* ACPI 6.3 - Node is a Leaf */
- socket_offset, uid++, NULL, 0);
- } else {
- build_processor_hierarchy_node(table_data, 0, socket_offset,
- core, NULL, 0);
-
- for (thread = 0; thread < ms->smp.threads; thread++) {
+ for (cluster = 0; cluster < vms->smp_clusters; cluster++) {
+ uint32_t cluster_offset = table_data->len - pptt_start;
+ int core;
+
+ build_processor_hierarchy_node(table_data, 0, socket_offset,
+ cluster, NULL, 0);
+
+ for (core = 0; core < ms->smp.cores; core++) {
+ uint32_t core_offset = table_data->len - pptt_start;
+ int thread;
+
+ if (ms->smp.threads <= 1) {
build_processor_hierarchy_node(
table_data,
(1 << 1) | /* ACPI 6.2 - ACPI Processor ID valid */
- (1 << 2) | /* ACPI 6.3 - Processor is a Thread */
(1 << 3), /* ACPI 6.3 - Node is a Leaf */
- core_offset, uid++, NULL, 0);
+ cluster_offset, uid++, NULL, 0);
+ } else {
+ build_processor_hierarchy_node(table_data, 0,
+ cluster_offset,
+ core, NULL, 0);
+
+ for (thread = 0; thread < ms->smp.threads; thread++) {
+ build_processor_hierarchy_node(
+ table_data,
+ (1 << 1) | /* ACPI 6.2 - ACPI Processor ID valid */
+ (1 << 2) | /* ACPI 6.3 - Processor is a Thread */
+ (1 << 3), /* ACPI 6.3 - Node is a Leaf */
+ core_offset, uid++, NULL, 0);
+ }
}
}
}
--
2.19.1
next prev parent reply other threads:[~2021-05-16 10:41 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-16 10:32 [RFC PATCH v3 0/4] hw/arm/virt: Introduce cluster cpu topology support Yanan Wang
2021-05-16 10:32 ` [RFC PATCH v3 1/4] vl.c: Add -smp, clusters=* command line support for ARM cpu Yanan Wang
2021-05-17 9:07 ` Andrew Jones
2021-05-17 15:07 ` wangyanan (Y)
2021-05-16 10:32 ` [RFC PATCH v3 2/4] hw/arm/virt: Add cluster level to device tree Yanan Wang
2021-05-16 10:32 ` Yanan Wang [this message]
2021-05-16 10:32 ` [RFC PATCH v3 4/4] hw/arm/virt: Parse -smp cluster parameter in virt_smp_parse Yanan Wang
2021-05-17 9:12 ` Andrew Jones
2021-05-17 15:10 ` wangyanan (Y)
2021-05-17 15:17 ` Salil Mehta
2021-05-18 3:48 ` wangyanan (Y)
2021-05-18 6:52 ` Salil Mehta
2021-05-18 8:19 ` Andrew Jones
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=20210516103228.37792-4-wangyanan55@huawei.com \
--to=wangyanan55@huawei.com \
--cc=drjones@redhat.com \
--cc=imammedo@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@redhat.com \
--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=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).