On 20/1/26 19:03, Peter Maydell wrote:
The virt board currently only supports either a GICv2 with a possible
GICv2m for handling MSI interrupts, or else a GICv3 with a possible
ITS for handling MSI interrupts.  There is one board property, which
lets you say "its=(off|on)" and controls only whether there is an ITS
or not.

This is awkward for macOS HVF, where you get a GICv3
without ITS and MSI handling needs a GICv2m.

Create a new board property "msi" which gives the user clearer
control over how MSI interrupts are handled:

  - msi=its : create an ITS
  - msi=gicv2m : create a GICv2m
  - msi=off : do not create any MSI handling device
  - msi=auto : create the best MSI handling device available
               for the GIC version and accelerator

The default is 'auto'.

The existing 'its' property becomes a deprecated property
kept for compatibility. Existing users of "its=on" should
prefer "msi=auto"; users of "its=off" should use "msi=off".

The backwards compatibility cases we need to support are:
  (1) TCG, virt-6.1 and earlier: no_tcg_its is set
    -- you can have a gicv2 (always with a gicv2m)
    -- if you specify gic-version=3 you get a GICv3 without ITS
  (2) TCG, virt-6.2 and later:
    -- gic-version=2 still has gicv2m
    -- gic-version=3 by default gives you an ITS; if you also
       say its=off you get GICv3 with no ITS
    -- there is no case where we provide a GICv3 and are
       unable to provide an ITS for it
  (3) KVM (any version):
    -- gic-version=2 has a gicv2m
    -- gic-version=3 gives you an ITS by default; its=off
       will remove it
    -- there is no case where we provide a GICv3 and are
       unable to provide an ITS for it
  (4) HVF:
    -- only gic-version=2 works, you get a gicv2m

Thanks for this verbose enumeration. I suppose you started writting
that down before your first line of code :)


Signed-off-by: Peter Maydell <[email protected]>
---
  docs/system/arm/virt.rst | 21 ++++++++++++-
  hw/arm/virt.c            | 64 +++++++++++++++++++++++++++++++++++++++-
  include/hw/arm/virt.h    |  1 +
  3 files changed, 84 insertions(+), 2 deletions(-)


diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index b65f571532..471852e4b1 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c


@@ -3454,7 +3507,13 @@ static void virt_machine_class_init(ObjectClass *oc, 
const void *data)
                                     virt_set_its);
      object_class_property_set_description(oc, "its",
                                            "Set on/off to enable/disable "
-                                          "ITS instantiation");
+                                          "ITS instantiation. Deprecated; "
+                                          "use the msi option instead");

"use the msi= option instead"

diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h
index 577b4b3362..53f1dc2199 100644
--- a/include/hw/arm/virt.h
+++ b/include/hw/arm/virt.h
@@ -103,6 +103,7 @@ typedef enum VirtMSIControllerType {
      VIRT_MSI_CTRL_NONE,
      VIRT_MSI_CTRL_GICV2M,
      VIRT_MSI_CTRL_ITS,
+    VIRT_MSI_CTRL_NOSEL,
  } VirtMSIControllerType;

Pre-existing, no need to expose these, we should restrict to virt.c.

Reviewed-by: Philippe Mathieu-Daudé <[email protected]>


Reply via email to