[PATCH v6 6/7] hw/arm/virt-acpi-build: Support cluster level in PPTT generation

Yanan Wang via posted 7 patches 4 years, 1 month ago
Maintainers: "Michael S. Tsirkin" <mst@redhat.com>, Ani Sinha <ani@anisinha.ca>, Shannon Zhao <shannon.zhaosl@gmail.com>, Peter Maydell <peter.maydell@linaro.org>, Igor Mammedov <imammedo@redhat.com>
There is a newer version of this series
[PATCH v6 6/7] hw/arm/virt-acpi-build: Support cluster level in PPTT generation
Posted by Yanan Wang via 4 years, 1 month ago
Support cluster level in generation of ACPI Processor Properties
Topology Table (PPTT) for ARM virt machines.

Signed-off-by: Yanan Wang <wangyanan55@huawei.com>
---
 hw/arm/virt-acpi-build.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
index 3ce7680393..5f91969688 100644
--- a/hw/arm/virt-acpi-build.c
+++ b/hw/arm/virt-acpi-build.c
@@ -840,6 +840,21 @@ build_pptt(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
             0, socket, NULL, 0);
     }
 
+    length = g_queue_get_length(list);
+    for (i = 0; i < length; i++) {
+        int cluster;
+
+        father_offset = GPOINTER_TO_UINT(g_queue_pop_head(list));
+        for (cluster = 0; cluster < ms->smp.clusters; cluster++) {
+            g_queue_push_tail(list,
+                GUINT_TO_POINTER(table_data->len - pptt_start));
+            build_processor_hierarchy_node(
+                table_data,
+                (0 << 0), /* not a physical package */
+                father_offset, cluster, NULL, 0);
+        }
+    }
+
     length = g_queue_get_length(list);
     for (i = 0; i < length; i++) {
         int core;
-- 
2.27.0


Re: [PATCH v6 6/7] hw/arm/virt-acpi-build: Support cluster level in PPTT generation
Posted by Andrew Jones 4 years, 1 month ago
On Mon, Jan 03, 2022 at 04:46:35PM +0800, Yanan Wang wrote:
> Support cluster level in generation of ACPI Processor Properties
> Topology Table (PPTT) for ARM virt machines.
> 
> Signed-off-by: Yanan Wang <wangyanan55@huawei.com>
> ---
>  hw/arm/virt-acpi-build.c | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
> index 3ce7680393..5f91969688 100644
> --- a/hw/arm/virt-acpi-build.c
> +++ b/hw/arm/virt-acpi-build.c
> @@ -840,6 +840,21 @@ build_pptt(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
>              0, socket, NULL, 0);
>      }
>  
> +    length = g_queue_get_length(list);
> +    for (i = 0; i < length; i++) {
> +        int cluster;
> +
> +        father_offset = GPOINTER_TO_UINT(g_queue_pop_head(list));
> +        for (cluster = 0; cluster < ms->smp.clusters; cluster++) {
> +            g_queue_push_tail(list,
> +                GUINT_TO_POINTER(table_data->len - pptt_start));
> +            build_processor_hierarchy_node(
> +                table_data,
> +                (0 << 0), /* not a physical package */
> +                father_offset, cluster, NULL, 0);
> +        }
> +    }
> +
>      length = g_queue_get_length(list);
>      for (i = 0; i < length; i++) {
>          int core;
> -- 
> 2.27.0
>

Looks good except please do s/father_offset/parent_offset/ as I mentioned
in an earlier patch.

Reviewed-by: Andrew Jones <drjones@redhat.com>


Re: [PATCH v6 6/7] hw/arm/virt-acpi-build: Support cluster level in PPTT generation
Posted by wangyanan (Y) via 4 years, 1 month ago
On 2022/1/3 19:32, Andrew Jones wrote:
> On Mon, Jan 03, 2022 at 04:46:35PM +0800, Yanan Wang wrote:
>> Support cluster level in generation of ACPI Processor Properties
>> Topology Table (PPTT) for ARM virt machines.
>>
>> Signed-off-by: Yanan Wang <wangyanan55@huawei.com>
>> ---
>>   hw/arm/virt-acpi-build.c | 15 +++++++++++++++
>>   1 file changed, 15 insertions(+)
>>
>> diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
>> index 3ce7680393..5f91969688 100644
>> --- a/hw/arm/virt-acpi-build.c
>> +++ b/hw/arm/virt-acpi-build.c
>> @@ -840,6 +840,21 @@ build_pptt(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
>>               0, socket, NULL, 0);
>>       }
>>   
>> +    length = g_queue_get_length(list);
>> +    for (i = 0; i < length; i++) {
>> +        int cluster;
>> +
>> +        father_offset = GPOINTER_TO_UINT(g_queue_pop_head(list));
>> +        for (cluster = 0; cluster < ms->smp.clusters; cluster++) {
>> +            g_queue_push_tail(list,
>> +                GUINT_TO_POINTER(table_data->len - pptt_start));
>> +            build_processor_hierarchy_node(
>> +                table_data,
>> +                (0 << 0), /* not a physical package */
>> +                father_offset, cluster, NULL, 0);
>> +        }
>> +    }
>> +
>>       length = g_queue_get_length(list);
>>       for (i = 0; i < length; i++) {
>>           int core;
>> -- 
>> 2.27.0
>>
> Looks good except please do s/father_offset/parent_offset/ as I mentioned
> in an earlier patch.
Will do.
>
> Reviewed-by: Andrew Jones <drjones@redhat.com>
>
Thanks,
Yanan