On 3 August 2015 at 08:19, Pavel Fedin <p.fe...@samsung.com> wrote: > Hello! > >> > gicdev = qdev_create(NULL, gictype); >> > - qdev_prop_set_uint32(gicdev, "revision", 2); >> > + >> > + for (i = 0; i < vbi->smp_cpus; i++) { >> > + CPUState *cpu = qemu_get_cpu(i); >> > + CPUARMState *env = cpu->env_ptr; >> > + env->nvic = gicdev; >> > + } >> >> We definitely need to come up with a something cleaner >> than this (which is ugly for two reasons > > This could be done: > a) as property > b) as global variable because 'gicdev' is a single of its kind. > > But, actually, this is currently only for TCG, which needs it in > order to forward system register accesses to GICv3 code. Would it > be OK if i just omit this assignment ?
Yes, I think so. I'm surprised we tell the CPU about the GIC pointer for the system register stuff -- I was expecting that we'd give the GIC a CPU pointer. (We could in theory implement some equivalent of the architected protocol between the redistributors and the CPU interfaces, but I think that would be overkill.) -- PMM