diff mbox series

[v3,4/5] tests: acpi: aarch64: add topology test for aarch64

Message ID 20221031090523.34146-5-yangyicong@huawei.com (mailing list archive)
State New, archived
Headers show
Series Only generate cluster node in PPTT when specified | expand

Commit Message

Yicong Yang Oct. 31, 2022, 9:05 a.m. UTC
From: Yicong Yang <yangyicong@hisilicon.com>

Add test for aarch64's ACPI topology building for all the supported
levels.

Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
---
 tests/qtest/bios-tables-test.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

Comments

Zhijian Li (Fujitsu)" via Oct. 31, 2022, 11:48 a.m. UTC | #1
Hi Yicong,

On 2022/10/31 17:05, Yicong Yang wrote:
> From: Yicong Yang <yangyicong@hisilicon.com>
>
> Add test for aarch64's ACPI topology building for all the supported
> levels.
>
> Acked-by: Michael S. Tsirkin <mst@redhat.com>
> Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
> ---
>   tests/qtest/bios-tables-test.c | 22 ++++++++++++++++++++++
>   1 file changed, 22 insertions(+)
>
> diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c
> index e6096e7f73..099b723444 100644
> --- a/tests/qtest/bios-tables-test.c
> +++ b/tests/qtest/bios-tables-test.c
> @@ -1533,6 +1533,27 @@ static void test_acpi_virt_tcg(void)
>       free_test_data(&data);
>   }
>   
> +static void test_acpi_virt_tcg_topology(void)
> +{
> +    test_data data = {
> +        .machine = "virt",
> +        .variant = ".topology",
> +        .tcg_only = true,
> +        .uefi_fl1 = "pc-bios/edk2-aarch64-code.fd",
> +        .uefi_fl2 = "pc-bios/edk2-arm-vars.fd",
> +        .cd = "tests/data/uefi-boot-images/bios-tables-test.aarch64.iso.qcow2",
> +        .ram_start = 0x40000000ULL,
> +        .scan_len = 128ULL * 1024 * 1024,
> +    };
> +
> +    data.smbios_cpu_max_speed = 2900;
> +    data.smbios_cpu_curr_speed = 2700;
I'm not sure. But why do we need this two lines?
Can we keep the test as simple as test_acpi_virt_tcg_numamem
and avoid unrelated parts.

Thanks,
Yanan
> +    test_acpi_one("-cpu cortex-a57 "
> +                  "-smbios type=4,max-speed=2900,current-speed=2700 "
> +                  "-smp sockets=1,clusters=2,cores=2,threads=2", &data);
> +    free_test_data(&data);
> +}
> +
>   static void test_acpi_q35_viot(void)
>   {
>       test_data data = {
> @@ -1864,6 +1885,7 @@ int main(int argc, char *argv[])
>       } else if (strcmp(arch, "aarch64") == 0) {
>           if (has_tcg) {
>               qtest_add_func("acpi/virt", test_acpi_virt_tcg);
> +            qtest_add_func("acpi/virt/topology", test_acpi_virt_tcg_topology);
>               qtest_add_func("acpi/virt/numamem", test_acpi_virt_tcg_numamem);
>               qtest_add_func("acpi/virt/memhp", test_acpi_virt_tcg_memhp);
>               qtest_add_func("acpi/virt/pxb", test_acpi_virt_tcg_pxb);
Yicong Yang Oct. 31, 2022, 12:45 p.m. UTC | #2
On 2022/10/31 19:48, wangyanan (Y) wrote:
> Hi Yicong,
> 
> On 2022/10/31 17:05, Yicong Yang wrote:
>> From: Yicong Yang <yangyicong@hisilicon.com>
>>
>> Add test for aarch64's ACPI topology building for all the supported
>> levels.
>>
>> Acked-by: Michael S. Tsirkin <mst@redhat.com>
>> Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
>> ---
>>   tests/qtest/bios-tables-test.c | 22 ++++++++++++++++++++++
>>   1 file changed, 22 insertions(+)
>>
>> diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c
>> index e6096e7f73..099b723444 100644
>> --- a/tests/qtest/bios-tables-test.c
>> +++ b/tests/qtest/bios-tables-test.c
>> @@ -1533,6 +1533,27 @@ static void test_acpi_virt_tcg(void)
>>       free_test_data(&data);
>>   }
>>   +static void test_acpi_virt_tcg_topology(void)
>> +{
>> +    test_data data = {
>> +        .machine = "virt",
>> +        .variant = ".topology",
>> +        .tcg_only = true,
>> +        .uefi_fl1 = "pc-bios/edk2-aarch64-code.fd",
>> +        .uefi_fl2 = "pc-bios/edk2-arm-vars.fd",
>> +        .cd = "tests/data/uefi-boot-images/bios-tables-test.aarch64.iso.qcow2",
>> +        .ram_start = 0x40000000ULL,
>> +        .scan_len = 128ULL * 1024 * 1024,
>> +    };
>> +
>> +    data.smbios_cpu_max_speed = 2900;
>> +    data.smbios_cpu_curr_speed = 2700;
> I'm not sure. But why do we need this two lines?
> Can we keep the test as simple as test_acpi_virt_tcg_numamem
> and avoid unrelated parts.
> 

I guess it's because my silly copy and paste... will make it simpler.

> Thanks,
> Yanan
>> +    test_acpi_one("-cpu cortex-a57 "
>> +                  "-smbios type=4,max-speed=2900,current-speed=2700 "
>> +                  "-smp sockets=1,clusters=2,cores=2,threads=2", &data);
>> +    free_test_data(&data);
>> +}
>> +
>>   static void test_acpi_q35_viot(void)
>>   {
>>       test_data data = {
>> @@ -1864,6 +1885,7 @@ int main(int argc, char *argv[])
>>       } else if (strcmp(arch, "aarch64") == 0) {
>>           if (has_tcg) {
>>               qtest_add_func("acpi/virt", test_acpi_virt_tcg);
>> +            qtest_add_func("acpi/virt/topology", test_acpi_virt_tcg_topology);
>>               qtest_add_func("acpi/virt/numamem", test_acpi_virt_tcg_numamem);
>>               qtest_add_func("acpi/virt/memhp", test_acpi_virt_tcg_memhp);
>>               qtest_add_func("acpi/virt/pxb", test_acpi_virt_tcg_pxb);
> 
> .
diff mbox series

Patch

diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c
index e6096e7f73..099b723444 100644
--- a/tests/qtest/bios-tables-test.c
+++ b/tests/qtest/bios-tables-test.c
@@ -1533,6 +1533,27 @@  static void test_acpi_virt_tcg(void)
     free_test_data(&data);
 }
 
+static void test_acpi_virt_tcg_topology(void)
+{
+    test_data data = {
+        .machine = "virt",
+        .variant = ".topology",
+        .tcg_only = true,
+        .uefi_fl1 = "pc-bios/edk2-aarch64-code.fd",
+        .uefi_fl2 = "pc-bios/edk2-arm-vars.fd",
+        .cd = "tests/data/uefi-boot-images/bios-tables-test.aarch64.iso.qcow2",
+        .ram_start = 0x40000000ULL,
+        .scan_len = 128ULL * 1024 * 1024,
+    };
+
+    data.smbios_cpu_max_speed = 2900;
+    data.smbios_cpu_curr_speed = 2700;
+    test_acpi_one("-cpu cortex-a57 "
+                  "-smbios type=4,max-speed=2900,current-speed=2700 "
+                  "-smp sockets=1,clusters=2,cores=2,threads=2", &data);
+    free_test_data(&data);
+}
+
 static void test_acpi_q35_viot(void)
 {
     test_data data = {
@@ -1864,6 +1885,7 @@  int main(int argc, char *argv[])
     } else if (strcmp(arch, "aarch64") == 0) {
         if (has_tcg) {
             qtest_add_func("acpi/virt", test_acpi_virt_tcg);
+            qtest_add_func("acpi/virt/topology", test_acpi_virt_tcg_topology);
             qtest_add_func("acpi/virt/numamem", test_acpi_virt_tcg_numamem);
             qtest_add_func("acpi/virt/memhp", test_acpi_virt_tcg_memhp);
             qtest_add_func("acpi/virt/pxb", test_acpi_virt_tcg_pxb);