On Mon, 23 Feb 2026 17:02:07 +0000 Peter Maydell <[email protected]> wrote:
> In this commit we create and connect up the GICv5. We do not > advertise it in the ACPI tables or DTB; that will be done in a > following commit. > > The user-facing gic-version property still only documents and permits > in its setter function the existing set of possible values; we won't > permit the user to select a GICv5 until all the code to handle it is > in place. > > Although we currently implement only the IRS, and only for EL1, > we reserve space in the virt board's memory map now for all the > register frames that the GICv5 may use. Each interrupt domain has: > * one IRS config register frame > * one ITS config register frame > * one ITS translate register frame > and each of these frames is 64K in size and 64K aligned and must be > at a unique address (that is, it is not permitted to have all the IRS > config register frames at the same physical address in the different > S/NS/etc physical address spaces). > > The addresses and layout of these frames are entirely up to the > implementation: software will be passed their addresses via firmware > data structures (ACPI or DTB). > > Signed-off-by: Peter Maydell <[email protected]> Reviewed-by: Jonathan Cameron <[email protected]> > --- > hw/arm/virt.c | 101 ++++++++++++++++++++++++++++++++++++++++++ > include/hw/arm/virt.h | 14 ++++++ > 2 files changed, 115 insertions(+) > > diff --git a/hw/arm/virt.c b/hw/arm/virt.c > index 3d19eb0fee..a9addf5ac0 100644 > --- a/hw/arm/virt.c > +++ b/hw/arm/virt.c > @@ -781,6 +795,49 @@ static void create_v2m(VirtMachineState *vms) > vms->msi_controller = VIRT_MSI_CTRL_GICV2M; > } > > +static void create_gicv5(VirtMachineState *vms, MemoryRegion *mem) > +{ > + MachineState *ms = MACHINE(vms); > + SysBusDevice *gicbusdev; > + const char *gictype = gicv5_class_name(); > + QList *cpulist = qlist_new(), *iaffidlist = qlist_new(); > + > + vms->gic = qdev_new(gictype); > + qdev_prop_set_uint32(vms->gic, "spi-range", NUM_IRQS); > + > + object_property_set_link(OBJECT(vms->gic), "sysmem", > + OBJECT(mem), &error_fatal); Trivial: I'd move OBJECT(mem) up a line. > +
