qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] tests/qtest/cpu-plug-test: Add cpu hotplug support for LoongArch
@ 2025-03-14  8:51 Bibo Mao
  2025-05-07  8:55 ` bibo mao
  0 siblings, 1 reply; 4+ messages in thread
From: Bibo Mao @ 2025-03-14  8:51 UTC (permalink / raw)
  To: Thomas Huth; +Cc: Igor Mammedov, qemu-devel

Add cpu hotplug testcase support for LoongArch system, it passes to
run with command "make check-qtest-loongarch64" as following:
  qemu:qtest+qtest-loongarch64 / qtest-loongarch64/cpu-plug-test OK 0.38s 1 subtests passed

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Reviewed-by: Thomas Huth <thuth@redhat.com>
---
v2 ... v3:
  1. Remove redundant check with machine type since it is constant
     string.

v1 ... v2:
  1. Call test function add_loongarch_test_case() directly rather than
     qtest_cb_for_every_machine() since compatible machine is not
     supported on LoongArch system.
  2. Add architecture specified test case in separate line.
---
 tests/qtest/cpu-plug-test.c | 24 ++++++++++++++++++++++++
 tests/qtest/meson.build     |  3 ++-
 2 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/tests/qtest/cpu-plug-test.c b/tests/qtest/cpu-plug-test.c
index 6633abfc10..44d704680b 100644
--- a/tests/qtest/cpu-plug-test.c
+++ b/tests/qtest/cpu-plug-test.c
@@ -156,6 +156,28 @@ static void add_s390x_test_case(const char *mname)
     g_free(path);
 }
 
+static void add_loongarch_test_case(const char *mname)
+{
+    char *path;
+    PlugTestData *data;
+
+    data = g_new(PlugTestData, 1);
+    data->machine = g_strdup(mname);
+    data->cpu_model = "la464";
+    data->device_model = g_strdup("la464-loongarch-cpu");
+    data->sockets = 1;
+    data->cores = 3;
+    data->threads = 1;
+    data->maxcpus = data->sockets * data->cores * data->threads;
+
+    path = g_strdup_printf("cpu-plug/%s/device-add/%ux%ux%u&maxcpus=%u",
+                           mname, data->sockets, data->cores,
+                           data->threads, data->maxcpus);
+    qtest_add_data_func_full(path, data, test_plug_with_device_add,
+                             test_data_free);
+    g_free(path);
+}
+
 int main(int argc, char **argv)
 {
     const char *arch = qtest_get_arch();
@@ -168,6 +190,8 @@ int main(int argc, char **argv)
         qtest_cb_for_every_machine(add_pseries_test_case, g_test_quick());
     } else if (g_str_equal(arch, "s390x")) {
         qtest_cb_for_every_machine(add_s390x_test_case, g_test_quick());
+    } else if (g_str_equal(arch, "loongarch64")) {
+        add_loongarch_test_case("virt");
     }
 
     return g_test_run();
diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build
index 5a8c1f102c..788093f744 100644
--- a/tests/qtest/meson.build
+++ b/tests/qtest/meson.build
@@ -149,7 +149,8 @@ qtests_hppa = \
 
 qtests_loongarch64 = qtests_filter + \
   (config_all_devices.has_key('CONFIG_LOONGARCH_VIRT') ? ['numa-test'] : []) + \
-  ['boot-serial-test']
+  ['boot-serial-test',
+   'cpu-plug-test']
 
 qtests_m68k = ['boot-serial-test'] + \
   qtests_filter

base-commit: 4c33c097f3a8a8093bcbaf097c3a178051e51b3e
-- 
2.39.3



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v3] tests/qtest/cpu-plug-test: Add cpu hotplug support for LoongArch
  2025-03-14  8:51 [PATCH v3] tests/qtest/cpu-plug-test: Add cpu hotplug support for LoongArch Bibo Mao
@ 2025-05-07  8:55 ` bibo mao
  2025-05-07  9:00   ` Thomas Huth
  0 siblings, 1 reply; 4+ messages in thread
From: bibo mao @ 2025-05-07  8:55 UTC (permalink / raw)
  To: Thomas Huth; +Cc: Igor Mammedov, qemu-devel

Hi Thomas,

Can this patch be merged since qemu 10.0 is released already?

Regards
Bibo Mao

On 2025/3/14 下午4:51, Bibo Mao wrote:
> Add cpu hotplug testcase support for LoongArch system, it passes to
> run with command "make check-qtest-loongarch64" as following:
>    qemu:qtest+qtest-loongarch64 / qtest-loongarch64/cpu-plug-test OK 0.38s 1 subtests passed
> 
> Signed-off-by: Bibo Mao <maobibo@loongson.cn>
> Reviewed-by: Thomas Huth <thuth@redhat.com>
> ---
> v2 ... v3:
>    1. Remove redundant check with machine type since it is constant
>       string.
> 
> v1 ... v2:
>    1. Call test function add_loongarch_test_case() directly rather than
>       qtest_cb_for_every_machine() since compatible machine is not
>       supported on LoongArch system.
>    2. Add architecture specified test case in separate line.
> ---
>   tests/qtest/cpu-plug-test.c | 24 ++++++++++++++++++++++++
>   tests/qtest/meson.build     |  3 ++-
>   2 files changed, 26 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/qtest/cpu-plug-test.c b/tests/qtest/cpu-plug-test.c
> index 6633abfc10..44d704680b 100644
> --- a/tests/qtest/cpu-plug-test.c
> +++ b/tests/qtest/cpu-plug-test.c
> @@ -156,6 +156,28 @@ static void add_s390x_test_case(const char *mname)
>       g_free(path);
>   }
>   
> +static void add_loongarch_test_case(const char *mname)
> +{
> +    char *path;
> +    PlugTestData *data;
> +
> +    data = g_new(PlugTestData, 1);
> +    data->machine = g_strdup(mname);
> +    data->cpu_model = "la464";
> +    data->device_model = g_strdup("la464-loongarch-cpu");
> +    data->sockets = 1;
> +    data->cores = 3;
> +    data->threads = 1;
> +    data->maxcpus = data->sockets * data->cores * data->threads;
> +
> +    path = g_strdup_printf("cpu-plug/%s/device-add/%ux%ux%u&maxcpus=%u",
> +                           mname, data->sockets, data->cores,
> +                           data->threads, data->maxcpus);
> +    qtest_add_data_func_full(path, data, test_plug_with_device_add,
> +                             test_data_free);
> +    g_free(path);
> +}
> +
>   int main(int argc, char **argv)
>   {
>       const char *arch = qtest_get_arch();
> @@ -168,6 +190,8 @@ int main(int argc, char **argv)
>           qtest_cb_for_every_machine(add_pseries_test_case, g_test_quick());
>       } else if (g_str_equal(arch, "s390x")) {
>           qtest_cb_for_every_machine(add_s390x_test_case, g_test_quick());
> +    } else if (g_str_equal(arch, "loongarch64")) {
> +        add_loongarch_test_case("virt");
>       }
>   
>       return g_test_run();
> diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build
> index 5a8c1f102c..788093f744 100644
> --- a/tests/qtest/meson.build
> +++ b/tests/qtest/meson.build
> @@ -149,7 +149,8 @@ qtests_hppa = \
>   
>   qtests_loongarch64 = qtests_filter + \
>     (config_all_devices.has_key('CONFIG_LOONGARCH_VIRT') ? ['numa-test'] : []) + \
> -  ['boot-serial-test']
> +  ['boot-serial-test',
> +   'cpu-plug-test']
>   
>   qtests_m68k = ['boot-serial-test'] + \
>     qtests_filter
> 
> base-commit: 4c33c097f3a8a8093bcbaf097c3a178051e51b3e
> 



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v3] tests/qtest/cpu-plug-test: Add cpu hotplug support for LoongArch
  2025-05-07  8:55 ` bibo mao
@ 2025-05-07  9:00   ` Thomas Huth
  2025-05-07 13:43     ` Fabiano Rosas
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Huth @ 2025-05-07  9:00 UTC (permalink / raw)
  To: bibo mao, Fabiano Rosas; +Cc: Igor Mammedov, qemu-devel

On 07/05/2025 10.55, bibo mao wrote:
> Hi Thomas,
> 
> Can this patch be merged since qemu 10.0 is released already?

  Hi,

Fabiano took over the maintainership of the qtests, so I'm forwarding the 
question to him.

  Regards,
   Thomas

> 
> On 2025/3/14 下午4:51, Bibo Mao wrote:
>> Add cpu hotplug testcase support for LoongArch system, it passes to
>> run with command "make check-qtest-loongarch64" as following:
>>    qemu:qtest+qtest-loongarch64 / qtest-loongarch64/cpu-plug-test OK 0.38s 
>> 1 subtests passed
>>
>> Signed-off-by: Bibo Mao <maobibo@loongson.cn>
>> Reviewed-by: Thomas Huth <thuth@redhat.com>
>> ---
>> v2 ... v3:
>>    1. Remove redundant check with machine type since it is constant
>>       string.
>>
>> v1 ... v2:
>>    1. Call test function add_loongarch_test_case() directly rather than
>>       qtest_cb_for_every_machine() since compatible machine is not
>>       supported on LoongArch system.
>>    2. Add architecture specified test case in separate line.
>> ---
>>   tests/qtest/cpu-plug-test.c | 24 ++++++++++++++++++++++++
>>   tests/qtest/meson.build     |  3 ++-
>>   2 files changed, 26 insertions(+), 1 deletion(-)
>>
>> diff --git a/tests/qtest/cpu-plug-test.c b/tests/qtest/cpu-plug-test.c
>> index 6633abfc10..44d704680b 100644
>> --- a/tests/qtest/cpu-plug-test.c
>> +++ b/tests/qtest/cpu-plug-test.c
>> @@ -156,6 +156,28 @@ static void add_s390x_test_case(const char *mname)
>>       g_free(path);
>>   }
>> +static void add_loongarch_test_case(const char *mname)
>> +{
>> +    char *path;
>> +    PlugTestData *data;
>> +
>> +    data = g_new(PlugTestData, 1);
>> +    data->machine = g_strdup(mname);
>> +    data->cpu_model = "la464";
>> +    data->device_model = g_strdup("la464-loongarch-cpu");
>> +    data->sockets = 1;
>> +    data->cores = 3;
>> +    data->threads = 1;
>> +    data->maxcpus = data->sockets * data->cores * data->threads;
>> +
>> +    path = g_strdup_printf("cpu-plug/%s/device-add/%ux%ux%u&maxcpus=%u",
>> +                           mname, data->sockets, data->cores,
>> +                           data->threads, data->maxcpus);
>> +    qtest_add_data_func_full(path, data, test_plug_with_device_add,
>> +                             test_data_free);
>> +    g_free(path);
>> +}
>> +
>>   int main(int argc, char **argv)
>>   {
>>       const char *arch = qtest_get_arch();
>> @@ -168,6 +190,8 @@ int main(int argc, char **argv)
>>           qtest_cb_for_every_machine(add_pseries_test_case, g_test_quick());
>>       } else if (g_str_equal(arch, "s390x")) {
>>           qtest_cb_for_every_machine(add_s390x_test_case, g_test_quick());
>> +    } else if (g_str_equal(arch, "loongarch64")) {
>> +        add_loongarch_test_case("virt");
>>       }
>>       return g_test_run();
>> diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build
>> index 5a8c1f102c..788093f744 100644
>> --- a/tests/qtest/meson.build
>> +++ b/tests/qtest/meson.build
>> @@ -149,7 +149,8 @@ qtests_hppa = \
>>   qtests_loongarch64 = qtests_filter + \
>>     (config_all_devices.has_key('CONFIG_LOONGARCH_VIRT') ? ['numa-test'] : 
>> []) + \
>> -  ['boot-serial-test']
>> +  ['boot-serial-test',
>> +   'cpu-plug-test']
>>   qtests_m68k = ['boot-serial-test'] + \
>>     qtests_filter
>>
>> base-commit: 4c33c097f3a8a8093bcbaf097c3a178051e51b3e
>>
> 



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v3] tests/qtest/cpu-plug-test: Add cpu hotplug support for LoongArch
  2025-05-07  9:00   ` Thomas Huth
@ 2025-05-07 13:43     ` Fabiano Rosas
  0 siblings, 0 replies; 4+ messages in thread
From: Fabiano Rosas @ 2025-05-07 13:43 UTC (permalink / raw)
  To: Thomas Huth, bibo mao; +Cc: Igor Mammedov, qemu-devel

Thomas Huth <thuth@redhat.com> writes:

> On 07/05/2025 10.55, bibo mao wrote:
>> Hi Thomas,
>> 
>> Can this patch be merged since qemu 10.0 is released already?
>
>   Hi,
>
> Fabiano took over the maintainership of the qtests, so I'm forwarding the 
> question to him.
>

Thank you.

I'll add this to my queue.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-05-07 13:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-14  8:51 [PATCH v3] tests/qtest/cpu-plug-test: Add cpu hotplug support for LoongArch Bibo Mao
2025-05-07  8:55 ` bibo mao
2025-05-07  9:00   ` Thomas Huth
2025-05-07 13:43     ` Fabiano Rosas

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).