diff mbox series

[06/16] tests: bios-tables-test: Add test for smbios type4 core count

Message ID 20230825033619.2075837-7-zhao1.liu@linux.intel.com
State New
Headers show
Series tests: Add CPU topology related smbios test cases | expand

Commit Message

Zhao Liu Aug. 25, 2023, 3:36 a.m. UTC
From: Zhao Liu <zhao1.liu@intel.com>

This tests the commit 196ea60a734c3 ("hw/smbios: Fix core count in
type4").

Test the core count field of type4 table for multiple sockets/dies case.

Suggested-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
---
 tests/qtest/bios-tables-test.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

Comments

Igor Mammedov Sept. 15, 2023, 1:03 p.m. UTC | #1
On Fri, 25 Aug 2023 11:36:09 +0800
Zhao Liu <zhao1.liu@linux.intel.com> wrote:

> From: Zhao Liu <zhao1.liu@intel.com>
> 
> This tests the commit 196ea60a734c3 ("hw/smbios: Fix core count in
> type4").
> 
> Test the core count field of type4 table for multiple sockets/dies case.
> 
> Suggested-by: Igor Mammedov <imammedo@redhat.com>
> Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
> ---
>  tests/qtest/bios-tables-test.c | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
> 
> diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c
> index 8679255449cf..a35c753a3a00 100644
> --- a/tests/qtest/bios-tables-test.c
> +++ b/tests/qtest/bios-tables-test.c
> @@ -999,6 +999,23 @@ static void test_acpi_q35_tcg_type4_count(void)
>      free_test_data(&data);
>  }
>  
> +static void test_acpi_q35_tcg_core_count(void)
> +{
> +    test_data data = {
> +        .machine = MACHINE_Q35,
> +        .variant = ".core-count",
> +        .required_struct_types = base_required_struct_types,
> +        .required_struct_types_len = ARRAY_SIZE(base_required_struct_types),
> +        .smbios_core_count = 9,
> +        .smbios_core_count2 = 9,
> +    };
> +
> +    test_acpi_one("-machine smbios-entry-point-type=64 "
> +                  "-smp 54,sockets=2,dies=3,cores=3,threads=3",

ditto as for 3/16
It's not obvious why this topology is used and how it correlates to  smbios_core_*
so describe setup in commit message

> +                  &data);
> +    free_test_data(&data);
> +}
> +
>  static void test_acpi_q35_tcg_core_count2(void)
>  {
>      test_data data = {
> @@ -2166,6 +2183,8 @@ int main(int argc, char *argv[])
>                  qtest_add_func("acpi/q35/kvm/dmar", test_acpi_q35_kvm_dmar);
>                  qtest_add_func("acpi/q35/type4-count",
>                                 test_acpi_q35_tcg_type4_count);
> +                qtest_add_func("acpi/q35/core-count",
> +                               test_acpi_q35_tcg_core_count);
>                  qtest_add_func("acpi/q35/core-count2",
>                                 test_acpi_q35_tcg_core_count2);
>              }
Zhao Liu Sept. 19, 2023, 7:21 a.m. UTC | #2
On Fri, Sep 15, 2023 at 03:03:07PM +0200, Igor Mammedov wrote:
> Date: Fri, 15 Sep 2023 15:03:07 +0200
> From: Igor Mammedov <imammedo@redhat.com>
> Subject: Re: [PATCH 06/16] tests: bios-tables-test: Add test for smbios
>  type4 core count
> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-redhat-linux-gnu)
> 
> On Fri, 25 Aug 2023 11:36:09 +0800
> Zhao Liu <zhao1.liu@linux.intel.com> wrote:
> 
> > From: Zhao Liu <zhao1.liu@intel.com>
> > 
> > This tests the commit 196ea60a734c3 ("hw/smbios: Fix core count in
> > type4").
> > 
> > Test the core count field of type4 table for multiple sockets/dies case.
> > 
> > Suggested-by: Igor Mammedov <imammedo@redhat.com>
> > Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
> > ---
> >  tests/qtest/bios-tables-test.c | 19 +++++++++++++++++++
> >  1 file changed, 19 insertions(+)
> > 
> > diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c
> > index 8679255449cf..a35c753a3a00 100644
> > --- a/tests/qtest/bios-tables-test.c
> > +++ b/tests/qtest/bios-tables-test.c
> > @@ -999,6 +999,23 @@ static void test_acpi_q35_tcg_type4_count(void)
> >      free_test_data(&data);
> >  }
> >  
> > +static void test_acpi_q35_tcg_core_count(void)
> > +{
> > +    test_data data = {
> > +        .machine = MACHINE_Q35,
> > +        .variant = ".core-count",
> > +        .required_struct_types = base_required_struct_types,
> > +        .required_struct_types_len = ARRAY_SIZE(base_required_struct_types),
> > +        .smbios_core_count = 9,
> > +        .smbios_core_count2 = 9,
> > +    };
> > +
> > +    test_acpi_one("-machine smbios-entry-point-type=64 "
> > +                  "-smp 54,sockets=2,dies=3,cores=3,threads=3",
> 
> ditto as for 3/16
> It's not obvious why this topology is used and how it correlates to  smbios_core_*
> so describe setup in commit message

Ok. I'll.

Thanks,
Zhao

> 
> > +                  &data);
> > +    free_test_data(&data);
> > +}
> > +
> >  static void test_acpi_q35_tcg_core_count2(void)
> >  {
> >      test_data data = {
> > @@ -2166,6 +2183,8 @@ int main(int argc, char *argv[])
> >                  qtest_add_func("acpi/q35/kvm/dmar", test_acpi_q35_kvm_dmar);
> >                  qtest_add_func("acpi/q35/type4-count",
> >                                 test_acpi_q35_tcg_type4_count);
> > +                qtest_add_func("acpi/q35/core-count",
> > +                               test_acpi_q35_tcg_core_count);
> >                  qtest_add_func("acpi/q35/core-count2",
> >                                 test_acpi_q35_tcg_core_count2);
> >              }
>
diff mbox series

Patch

diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c
index 8679255449cf..a35c753a3a00 100644
--- a/tests/qtest/bios-tables-test.c
+++ b/tests/qtest/bios-tables-test.c
@@ -999,6 +999,23 @@  static void test_acpi_q35_tcg_type4_count(void)
     free_test_data(&data);
 }
 
+static void test_acpi_q35_tcg_core_count(void)
+{
+    test_data data = {
+        .machine = MACHINE_Q35,
+        .variant = ".core-count",
+        .required_struct_types = base_required_struct_types,
+        .required_struct_types_len = ARRAY_SIZE(base_required_struct_types),
+        .smbios_core_count = 9,
+        .smbios_core_count2 = 9,
+    };
+
+    test_acpi_one("-machine smbios-entry-point-type=64 "
+                  "-smp 54,sockets=2,dies=3,cores=3,threads=3",
+                  &data);
+    free_test_data(&data);
+}
+
 static void test_acpi_q35_tcg_core_count2(void)
 {
     test_data data = {
@@ -2166,6 +2183,8 @@  int main(int argc, char *argv[])
                 qtest_add_func("acpi/q35/kvm/dmar", test_acpi_q35_kvm_dmar);
                 qtest_add_func("acpi/q35/type4-count",
                                test_acpi_q35_tcg_type4_count);
+                qtest_add_func("acpi/q35/core-count",
+                               test_acpi_q35_tcg_core_count);
                 qtest_add_func("acpi/q35/core-count2",
                                test_acpi_q35_tcg_core_count2);
             }