xen/arm: vgic: Optimize the way to store GICD_IPRIORITYR in the rank
authorJulien Grall <julien.grall@citrix.com>
Wed, 7 Oct 2015 14:41:07 +0000 (15:41 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 8 Oct 2015 11:22:46 +0000 (12:22 +0100)
commitf699fd55e9860aa207945abbaadac44855caf6e5
tree19fb0d9454cf7d3b6ba8635e9d90430b3d366afa
parent17c9bc64551ef4b829735de3786083456ed60941
xen/arm: vgic: Optimize the way to store GICD_IPRIORITYR in the rank

Xen is currently directly storing the value of GICD_IPRIORITYR register
in the rank. This makes emulation of the register access very simple
but makes the code to get the priority for a given vIRQ more complex.

While the priority of an vIRQ is retrieved every time an vIRQ is injected
to the guest, the access to register occurs less often.

Each GICD_IPRIORITYR register stores 4 priorities associated for 4 vIRQs
(see 4.3.11 in IHI 0048B). As Xen is using little endian, we can use
an union to access directly a register or a priority for a given IRQ.

Note that the field "ipriority" has been renamed to "ipriorityr" to
match the name of the register in the GIC spec.

Finally, the implementation of the callback get_irq_priority is exactly
the same for both vGIC drivers. Consolidate the implementation in the
common vGIC code and drop the callback.

Signed-off-by: Julien Grall <julien.grall@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen/arch/arm/vgic-v2.c
xen/arch/arm/vgic-v3.c
xen/arch/arm/vgic.c
xen/include/asm-arm/vgic.h