All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hw/arm/virt: Extend nested and mte checks to hvf
@ 2021-11-23 12:28 Alexander Graf
  2021-11-23 12:34 ` Peter Maydell
  0 siblings, 1 reply; 4+ messages in thread
From: Alexander Graf @ 2021-11-23 12:28 UTC (permalink / raw)
  To: qemu-arm
  Cc: Alex Bennée, Peter Maydell, Richard Henderson, qemu-devel,
	saar amar

The virt machine has properties to enable MTE and Nested Virtualization
support. However, its check to ensure the backing accel implementation
supports it today only looks for KVM and bails out if it finds it.

Extend the checks to HVF as well as it does not support either today.

Reported-by: saar amar <saaramar5@gmail.com>
Signed-off-by: Alexander Graf <agraf@csgraf.de>
---
 hw/arm/virt.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 369552ad45..30da05dfe0 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -49,6 +49,7 @@
 #include "sysemu/runstate.h"
 #include "sysemu/tpm.h"
 #include "sysemu/kvm.h"
+#include "sysemu/hvf.h"
 #include "hw/loader.h"
 #include "qapi/error.h"
 #include "qemu/bitops.h"
@@ -1969,15 +1970,17 @@ static void machvirt_init(MachineState *machine)
         exit(1);
     }
 
-    if (vms->virt && kvm_enabled()) {
-        error_report("mach-virt: KVM does not support providing "
-                     "Virtualization extensions to the guest CPU");
+    if (vms->virt && (kvm_enabled() || hvf_enabled())) {
+        error_report("mach-virt: %s does not support providing "
+                     "Virtualization extensions to the guest CPU",
+                     kvm_enabled() ? "KVM" : "HVF");
         exit(1);
     }
 
-    if (vms->mte && kvm_enabled()) {
-        error_report("mach-virt: KVM does not support providing "
-                     "MTE to the guest CPU");
+    if (vms->mte && (kvm_enabled() || hvf_enabled())) {
+        error_report("mach-virt: %s does not support providing "
+                     "MTE to the guest CPU",
+                     kvm_enabled() ? "KVM" : "HVF");
         exit(1);
     }
 
-- 
2.30.1 (Apple Git-130)



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

* Re: [PATCH] hw/arm/virt: Extend nested and mte checks to hvf
  2021-11-23 12:28 [PATCH] hw/arm/virt: Extend nested and mte checks to hvf Alexander Graf
@ 2021-11-23 12:34 ` Peter Maydell
  2021-11-23 14:00   ` Alexander Graf
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Maydell @ 2021-11-23 12:34 UTC (permalink / raw)
  To: Alexander Graf
  Cc: Alex Bennée, qemu-arm, Richard Henderson, qemu-devel, saar amar

On Tue, 23 Nov 2021 at 12:29, Alexander Graf <agraf@csgraf.de> wrote:
>
> The virt machine has properties to enable MTE and Nested Virtualization
> support. However, its check to ensure the backing accel implementation
> supports it today only looks for KVM and bails out if it finds it.
>
> Extend the checks to HVF as well as it does not support either today.
>
> Reported-by: saar amar <saaramar5@gmail.com>
> Signed-off-by: Alexander Graf <agraf@csgraf.de>

Without this check, what happens if you try to enable
both eg virtualization and hvf? Crash, unhelpful error
message, something else?

thanks
-- PMM


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

* Re: [PATCH] hw/arm/virt: Extend nested and mte checks to hvf
  2021-11-23 12:34 ` Peter Maydell
@ 2021-11-23 14:00   ` Alexander Graf
  2021-11-26 16:52     ` Peter Maydell
  0 siblings, 1 reply; 4+ messages in thread
From: Alexander Graf @ 2021-11-23 14:00 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Alex Bennée, qemu-arm, Richard Henderson, qemu-devel, saar amar


On 23.11.21 13:34, Peter Maydell wrote:
> On Tue, 23 Nov 2021 at 12:29, Alexander Graf <agraf@csgraf.de> wrote:
>> The virt machine has properties to enable MTE and Nested Virtualization
>> support. However, its check to ensure the backing accel implementation
>> supports it today only looks for KVM and bails out if it finds it.
>>
>> Extend the checks to HVF as well as it does not support either today.
>>
>> Reported-by: saar amar <saaramar5@gmail.com>
>> Signed-off-by: Alexander Graf <agraf@csgraf.de>
> Without this check, what happens if you try to enable
> both eg virtualization and hvf? Crash, unhelpful error
> message, something else?


The guest just never gets either feature enabled. No crash, no error 
message.


Alex




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

* Re: [PATCH] hw/arm/virt: Extend nested and mte checks to hvf
  2021-11-23 14:00   ` Alexander Graf
@ 2021-11-26 16:52     ` Peter Maydell
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2021-11-26 16:52 UTC (permalink / raw)
  To: Alexander Graf
  Cc: Alex Bennée, qemu-arm, Richard Henderson, qemu-devel, saar amar

On Tue, 23 Nov 2021 at 14:00, Alexander Graf <agraf@csgraf.de> wrote:
>
>
> On 23.11.21 13:34, Peter Maydell wrote:
> > On Tue, 23 Nov 2021 at 12:29, Alexander Graf <agraf@csgraf.de> wrote:
> >> The virt machine has properties to enable MTE and Nested Virtualization
> >> support. However, its check to ensure the backing accel implementation
> >> supports it today only looks for KVM and bails out if it finds it.
> >>
> >> Extend the checks to HVF as well as it does not support either today.
> >>
> >> Reported-by: saar amar <saaramar5@gmail.com>
> >> Signed-off-by: Alexander Graf <agraf@csgraf.de>
> > Without this check, what happens if you try to enable
> > both eg virtualization and hvf? Crash, unhelpful error
> > message, something else?
>
>
> The guest just never gets either feature enabled. No crash, no error
> message.

Thanks; I've added that info to the commit message and applied this
to target-arm.next for 6.2.

-- PMM


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

end of thread, other threads:[~2021-11-26 16:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-23 12:28 [PATCH] hw/arm/virt: Extend nested and mte checks to hvf Alexander Graf
2021-11-23 12:34 ` Peter Maydell
2021-11-23 14:00   ` Alexander Graf
2021-11-26 16:52     ` Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.