diff mbox series

[7/7] tests/qtest/migration: Allow using accelerators different of TCG / KVM

Message ID 20250128135429.8500-8-philmd@linaro.org
State New
Headers show
Series tests/qtest/migration: Update framework to allow using HVF accelerator | expand

Commit Message

Philippe Mathieu-Daudé Jan. 28, 2025, 1:54 p.m. UTC
There is no particular reason to restrict all the framework
to TCG or KVM, since we can check on a per-test basis which
accelerator is available (via MigrationTestEnv::has_$ACCEL).

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 tests/qtest/migration/framework.c | 5 -----
 1 file changed, 5 deletions(-)

Comments

Fabiano Rosas Jan. 28, 2025, 3:04 p.m. UTC | #1
Philippe Mathieu-Daudé <philmd@linaro.org> writes:

> There is no particular reason to restrict all the framework
> to TCG or KVM, since we can check on a per-test basis which
> accelerator is available (via MigrationTestEnv::has_$ACCEL).

The reason is:

CONFIG_KVM=n
CONFIG_TCG=n

The check is about "there is no accelerator at all".

>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>  tests/qtest/migration/framework.c | 5 -----
>  1 file changed, 5 deletions(-)
>
> diff --git a/tests/qtest/migration/framework.c b/tests/qtest/migration/framework.c
> index 30808de14e0..e5f0712c266 100644
> --- a/tests/qtest/migration/framework.c
> +++ b/tests/qtest/migration/framework.c
> @@ -950,11 +950,6 @@ MigrationTestEnv *migration_get_env(void)
>      env->has_hvf = qtest_has_accel("hvf");
>      env->has_tcg = qtest_has_accel("tcg");
>  
> -    if (!env->has_tcg && !env->has_kvm) {
> -        g_test_skip("No KVM or TCG accelerator available");
> -        return env;
> -    }
> -
>      env->has_dirty_ring = env->has_kvm && kvm_dirty_ring_supported();
>      env->has_uffd = ufd_version_check(&env->uffd_feature_thread_id);
>      env->is_x86 = !strcmp(env->arch, "i386") || !strcmp(env->arch, "x86_64");
Richard Henderson Jan. 28, 2025, 7:26 p.m. UTC | #2
On 1/28/25 05:54, Philippe Mathieu-Daudé wrote:
> There is no particular reason to restrict all the framework
> to TCG or KVM, since we can check on a per-test basis which
> accelerator is available (viaMigrationTestEnv::has_$ACCEL).
> 
> Signed-off-by: Philippe Mathieu-Daudé<philmd@linaro.org>
> ---
>   tests/qtest/migration/framework.c | 5 -----
>   1 file changed, 5 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~
Richard Henderson Jan. 28, 2025, 7:29 p.m. UTC | #3
On 1/28/25 07:04, Fabiano Rosas wrote:
> Philippe Mathieu-Daudé <philmd@linaro.org> writes:
> 
>> There is no particular reason to restrict all the framework
>> to TCG or KVM, since we can check on a per-test basis which
>> accelerator is available (via MigrationTestEnv::has_$ACCEL).
> 
> The reason is:
> 
> CONFIG_KVM=n
> CONFIG_TCG=n
> 
> The check is about "there is no accelerator at all".

We perform the no accelerator check in meson.build on a per-target basis.
So you'll never have a qemu-system-foo binary with zero accelerators.


r~
Fabiano Rosas Jan. 28, 2025, 7:50 p.m. UTC | #4
Richard Henderson <richard.henderson@linaro.org> writes:

> On 1/28/25 07:04, Fabiano Rosas wrote:
>> Philippe Mathieu-Daudé <philmd@linaro.org> writes:
>> 
>>> There is no particular reason to restrict all the framework
>>> to TCG or KVM, since we can check on a per-test basis which
>>> accelerator is available (via MigrationTestEnv::has_$ACCEL).
>> 
>> The reason is:
>> 
>> CONFIG_KVM=n
>> CONFIG_TCG=n
>> 
>> The check is about "there is no accelerator at all".
>
> We perform the no accelerator check in meson.build on a per-target basis.
> So you'll never have a qemu-system-foo binary with zero accelerators.
>

Ok, the issue was not zero accelerators, but Xen. On aarch64, this
produces a binary with no TCG nor KVM:

--target-list=x86_64-softmmu --disable-tcg --enable-xen
Richard Henderson Jan. 28, 2025, 9:08 p.m. UTC | #5
On 1/28/25 11:50, Fabiano Rosas wrote:
> Richard Henderson <richard.henderson@linaro.org> writes:
> 
>> On 1/28/25 07:04, Fabiano Rosas wrote:
>>> Philippe Mathieu-Daudé <philmd@linaro.org> writes:
>>>
>>>> There is no particular reason to restrict all the framework
>>>> to TCG or KVM, since we can check on a per-test basis which
>>>> accelerator is available (via MigrationTestEnv::has_$ACCEL).
>>>
>>> The reason is:
>>>
>>> CONFIG_KVM=n
>>> CONFIG_TCG=n
>>>
>>> The check is about "there is no accelerator at all".
>>
>> We perform the no accelerator check in meson.build on a per-target basis.
>> So you'll never have a qemu-system-foo binary with zero accelerators.
>>
> 
> Ok, the issue was not zero accelerators, but Xen. On aarch64, this
> produces a binary with no TCG nor KVM:
> 
> --target-list=x86_64-softmmu --disable-tcg --enable-xen

Right.  Phil's patch set specifically mentions HVF, but there's no reason Xen can't be 
better handled too.  Unless there's something explicit about Xen that cannot be handled 
here?  But even then, the if condition needs updating.


r~
diff mbox series

Patch

diff --git a/tests/qtest/migration/framework.c b/tests/qtest/migration/framework.c
index 30808de14e0..e5f0712c266 100644
--- a/tests/qtest/migration/framework.c
+++ b/tests/qtest/migration/framework.c
@@ -950,11 +950,6 @@  MigrationTestEnv *migration_get_env(void)
     env->has_hvf = qtest_has_accel("hvf");
     env->has_tcg = qtest_has_accel("tcg");
 
-    if (!env->has_tcg && !env->has_kvm) {
-        g_test_skip("No KVM or TCG accelerator available");
-        return env;
-    }
-
     env->has_dirty_ring = env->has_kvm && kvm_dirty_ring_supported();
     env->has_uffd = ufd_version_check(&env->uffd_feature_thread_id);
     env->is_x86 = !strcmp(env->arch, "i386") || !strcmp(env->arch, "x86_64");