On Thu, May 25, 2017 at 03:53:10PM +0200, Paolo Bonzini wrote: > > > On 25/05/2017 12:28, Andrew Jones wrote: > > +int gic_init(void) > > +{ > > + if (gicv2_init()) > > + gic_common_ops = &gicv2_common_ops; > > + else if (gicv3_init()) > > + gic_common_ops = &gicv3_common_ops; > > + return gic_version(); > > +} > > + > > Of the other uses of gic_version(), this one is the ugliest: > > if (gic_version() == 2) > base = gicv2_dist_base(); > else > base = gicv3_redist_base(); > > writel(val, base + GICD_ICACTIVER); > > Could you change this writel to a new op gicv[23]_eoi or something like > that? That use is just for an irq handler specific to a single unit test, and at this time I don't think we need an op for that writel, as that's the only place we currently write that register. I do have some plans for irq handler refactoring in arm/gic.c, in order to prepare for more tests. I'll clean this up a bit when I do that. Thanks, drew