[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-arm] [PATCH] aarch64: advertise the GIC system register interf
From: |
Stefano Stabellini |
Subject: |
Re: [Qemu-arm] [PATCH] aarch64: advertise the GIC system register interface |
Date: |
Tue, 31 Oct 2017 11:51:21 -0700 (PDT) |
User-agent: |
Alpine 2.10 (DEB 1266 2009-07-14) |
On Tue, 31 Oct 2017, Peter Maydell wrote:
> On 31 October 2017 at 17:01, Stefano Stabellini <address@hidden> wrote:
> > Fixing QEMU is harder than I expected. Would it be possible to update
> > id_aa64pfr0 at CPU reset time? Like cpu->id_aa64pfr0 |= 0x01000000; ?
>
> At that point we've already called register_cp_regs_for_features(),
> which is where we read cpu->id_aa64pfr0 when we're creating the
> cpreg. So if you change it after that it's too late. But that
> function is called at CPU realize time, which is before we've
> created the GIC object...
What about something along the lines of
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 9e18b41..0851071 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -1401,6 +1400,10 @@ static void machvirt_init(MachineState *machine)
object_property_set_link(cpuobj, OBJECT(secure_sysmem),
"secure-memory", &error_abort);
}
+ if (vms->gic_version == 3) {
+ ARMCPU *cpu = ARM_CPU(cpuobj);
+ cpu->id_aa64pfr0 |= 0x01000000;
+ }
object_property_set_bool(cpuobj, true, "realized", NULL);
object_unref(cpuobj);