[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-arm] [PATCH v2] aarch64: advertise the GIC system register int
From: |
Stefano Stabellini |
Subject: |
Re: [Qemu-arm] [PATCH v2] aarch64: advertise the GIC system register interface |
Date: |
Tue, 7 Nov 2017 09:57:38 -0800 (PST) |
User-agent: |
Alpine 2.10 (DEB 1266 2009-07-14) |
On Tue, 7 Nov 2017, Peter Maydell wrote:
> On 6 November 2017 at 22:16, Stefano Stabellini <address@hidden> wrote:
> > When QEMU emulates a GICv3, it needs to advertise the presence of the
> > system register interface, which is done via id_aa64pfr0.
> >
> > To do that, and at the same time to avoid advertising the presence of
> > the system register interface when it is actually not available, set a
> > boolean property in machvirt_init. Check on the boolean property from
> > register_cp_regs_for_features and set id_aa64pfr0 accordingly.
> >
> > Signed-off-by: Stefano Stabellini <address@hidden>
> >
> > diff --git a/hw/arm/virt.c b/hw/arm/virt.c
> > index 9e18b41..369d36b 100644
> > --- a/hw/arm/virt.c
> > +++ b/hw/arm/virt.c
> > @@ -1401,6 +1401,9 @@ static void machvirt_init(MachineState *machine)
> > object_property_set_link(cpuobj, OBJECT(secure_sysmem),
> > "secure-memory", &error_abort);
> > }
> > + if (vms->gic_version == 3) {
> > + object_property_set_bool(cpuobj, true, "gicv3-sysregs", NULL);
> > + }
> >
> > object_property_set_bool(cpuobj, true, "realized", NULL);
> > object_unref(cpuobj);
>
> I thought about this on the cycle into work this morning, and I
> think that rather than require every board that uses gicv3
> to set a property on the CPU, we should change the definition
> of the id_aa64pfr0 register so that rather than being ARM_CP_CONST
> it has a readfn, and then at runtime we can get that readfn to
> add in the right bit if env->gicv3state is non-null.
>
> I'll put together a patch this afternoon.
Great, please CC me when you do, I'll help you test the patch.