ARM: GICv3: poke_irq: make RWP optional
authorAndre Przywara <andre.przywara@linaro.org>
Fri, 9 Mar 2018 15:11:32 +0000 (15:11 +0000)
committerJulien Grall <julien.grall@arm.com>
Mon, 12 Mar 2018 11:45:36 +0000 (11:45 +0000)
commitbd04d3b3d7aa1311a8e87321a398ace978ed7a53
treebde083b469444a906c5761cd2e98ca61404100f8
parent332238e05bdb9276ced85ef9111339e1231bef76
ARM: GICv3: poke_irq: make RWP optional

A GICv3 hardware implementation can be implemented in several parts that
communicate with each other (think multi-socket systems).
To make sure that critical settings have arrived at all endpoints, some
bits are tracked using the RWP bit in the GICD_CTLR register, which
signals whether a register write is still in progress.
However this only applies to *some* registers, namely the bits in the
GICD_ICENABLER (disabling interrupts) and some bits in the GICD_CTLR
register (cf. Arm IHI 0069D, 8.9.4: RWP, bit[31]).
But our gicv3_poke_irq() was always polling this bit before returning,
resulting in pointless MMIO reads for many registers.
Add an option to gicv3_poke_irq() to state whether we want to wait for
this bit and use it accordingly to match the spec.
Replace a "1 << " with a "1U << " on the way to fix a potentially
undefined behaviour when the argument evaluates to 31.

Signed-off-by: Andre Przywara <andre.przywara@linaro.org>
Reviewed-by: Julien Grall <julien.grall@arm.com>
xen/arch/arm/gic-v3.c