[RFC PATCH 01/19] hw/arm/virt: Only require TCG || QTest to use virtualization extension

Philippe Mathieu-Daudé posted 19 patches 8 months, 1 week ago
Maintainers: Richard Henderson <richard.henderson@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>, Cameron Esfahani <dirty@apple.com>, Roman Bolshakov <rbolshakov@ddn.com>, Phil Dennis-Jordan <phil@philjordan.eu>, Fabiano Rosas <farosas@suse.de>, Laurent Vivier <lvivier@redhat.com>, Stefano Stabellini <sstabellini@kernel.org>, Anthony PERARD <anthony@xenproject.org>, Paul Durrant <paul@xen.org>, "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, Warner Losh <imp@bsdimp.com>, Kyle Evans <kevans@freebsd.org>, Peter Maydell <peter.maydell@linaro.org>, Reinoud Zandijk <reinoud@netbsd.org>, Sunil Muthuswamy <sunilmut@microsoft.com>
There is a newer version of this series
[RFC PATCH 01/19] hw/arm/virt: Only require TCG || QTest to use virtualization extension
Posted by Philippe Mathieu-Daudé 8 months, 1 week ago
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/arm/virt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 9a6cd085a37..d55ce2c0f4e 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -2205,7 +2205,7 @@ static void machvirt_init(MachineState *machine)
         exit(1);
     }
 
-    if (vms->virt && (kvm_enabled() || hvf_enabled())) {
+    if (vms->virt && !tcg_enabled() && !qtest_enabled()) {
         error_report("mach-virt: %s does not support providing "
                      "Virtualization extensions to the guest CPU",
                      current_accel_name());
-- 
2.49.0


Re: [RFC PATCH 01/19] hw/arm/virt: Only require TCG || QTest to use virtualization extension
Posted by Miguel Luis 8 months ago
Hi Philippe,

> On 6 Jun 2025, at 16:44, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> hw/arm/virt.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/arm/virt.c b/hw/arm/virt.c
> index 9a6cd085a37..d55ce2c0f4e 100644
> --- a/hw/arm/virt.c
> +++ b/hw/arm/virt.c
> @@ -2205,7 +2205,7 @@ static void machvirt_init(MachineState *machine)
>         exit(1);
>     }
> 
> -    if (vms->virt && (kvm_enabled() || hvf_enabled())) {
> +    if (vms->virt && !tcg_enabled() && !qtest_enabled()) {

Does this means TCG won’t run aarch64 NV?

Miguel

>         error_report("mach-virt: %s does not support providing "
>                      "Virtualization extensions to the guest CPU",
>                      current_accel_name());
> -- 
> 2.49.0
> 
> 

Re: [RFC PATCH 01/19] hw/arm/virt: Only require TCG || QTest to use virtualization extension
Posted by Alex Bennée 8 months ago
Miguel Luis <miguel.luis@oracle.com> writes:

> Hi Philippe,
>
>> On 6 Jun 2025, at 16:44, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>> 
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> ---
>> hw/arm/virt.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/hw/arm/virt.c b/hw/arm/virt.c
>> index 9a6cd085a37..d55ce2c0f4e 100644
>> --- a/hw/arm/virt.c
>> +++ b/hw/arm/virt.c
>> @@ -2205,7 +2205,7 @@ static void machvirt_init(MachineState *machine)
>>         exit(1);
>>     }
>> 
>> -    if (vms->virt && (kvm_enabled() || hvf_enabled())) {
>> +    if (vms->virt && !tcg_enabled() && !qtest_enabled()) {
>
> Does this means TCG won’t run aarch64 NV?

No - it just means we can't start in EL2 with anything but TCG (or
qtest). Currently we don't have NV support for KVM in QEMU.


BTW Philippe isn't the same test needed above for secure (which can't be
supported even with KVM NV support).

>
> Miguel
>
>>         error_report("mach-virt: %s does not support providing "
>>                      "Virtualization extensions to the guest CPU",
>>                      current_accel_name());
>> -- 
>> 2.49.0
>> 
>> 

-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro
Re: [RFC PATCH 01/19] hw/arm/virt: Only require TCG || QTest to use virtualization extension
Posted by Miguel Luis 8 months ago
Hi Alex,

> On 11 Jun 2025, at 14:31, Alex Bennée <alex.bennee@linaro.org> wrote:
> 
> Miguel Luis <miguel.luis@oracle.com> writes:
> 
>> Hi Philippe,
>> 
>>> On 6 Jun 2025, at 16:44, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>>> 
>>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>>> ---
>>> hw/arm/virt.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>> 
>>> diff --git a/hw/arm/virt.c b/hw/arm/virt.c
>>> index 9a6cd085a37..d55ce2c0f4e 100644
>>> --- a/hw/arm/virt.c
>>> +++ b/hw/arm/virt.c
>>> @@ -2205,7 +2205,7 @@ static void machvirt_init(MachineState *machine)
>>>        exit(1);
>>>    }
>>> 
>>> -    if (vms->virt && (kvm_enabled() || hvf_enabled())) {
>>> +    if (vms->virt && !tcg_enabled() && !qtest_enabled()) {
>> 
>> Does this means TCG won’t run aarch64 NV?
> 
> No - it just means we can't start in EL2 with anything but TCG (or
> qtest).

Oh, of course.. now that I read it again.

Apologies for the noise and thanks for clarifying.

Regards,
Miguel

> Currently we don't have NV support for KVM in QEMU.
> 
> 
> BTW Philippe isn't the same test needed above for secure (which can't be
> supported even with KVM NV support).
> 
>> 
>> Miguel
>> 
>>>        error_report("mach-virt: %s does not support providing "
>>>                     "Virtualization extensions to the guest CPU",
>>>                     current_accel_name());
>>> -- 
>>> 2.49.0
>>> 
>>> 
> 
> -- 
> Alex Bennée
> Virtualisation Tech Lead @ Linaro


Re: [RFC PATCH 01/19] hw/arm/virt: Only require TCG || QTest to use virtualization extension
Posted by Alex Bennée 8 months ago
Philippe Mathieu-Daudé <philmd@linaro.org> writes:

> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>

-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro
Re: [RFC PATCH 01/19] hw/arm/virt: Only require TCG || QTest to use virtualization extension
Posted by Richard Henderson 8 months ago
On 6/6/25 17:44, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   hw/arm/virt.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/arm/virt.c b/hw/arm/virt.c
> index 9a6cd085a37..d55ce2c0f4e 100644
> --- a/hw/arm/virt.c
> +++ b/hw/arm/virt.c
> @@ -2205,7 +2205,7 @@ static void machvirt_init(MachineState *machine)
>           exit(1);
>       }
>   
> -    if (vms->virt && (kvm_enabled() || hvf_enabled())) {
> +    if (vms->virt && !tcg_enabled() && !qtest_enabled()) {
>           error_report("mach-virt: %s does not support providing "
>                        "Virtualization extensions to the guest CPU",
>                        current_accel_name());

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

r~