irqchip/gic-v3-its: Reset each ITS's BASERn register before probe
authorMarc Zyngier <maz@kernel.org>
Mon, 24 Jan 2022 13:38:09 +0000 (13:38 +0000)
committerMarc Zyngier <maz@kernel.org>
Wed, 26 Jan 2022 11:10:28 +0000 (11:10 +0000)
commitc733ebb7cb67dfb146a07c0ae329a0de9ec52f36
tree14c74e8d3462114d40faef82b9205cf4d53bde60
parent16436f70abeebb29cd99444e27b310755806c1fa
irqchip/gic-v3-its: Reset each ITS's BASERn register before probe

A recent bug report outlined that the way GICv4.1 is handled across
kexec is pretty bad. We can end-up in a situation where ITSs share
memory (this is the case when SVPET==1) and reprogram the base
registers, creating a situation where ITSs that are part of a given
affinity group see different pointers. Which is illegal. Boo.

In order to restore some sanity, reset the BASERn registers to 0
*before* probing any ITS. Although this isn't optimised at all,
this is only a once-per-boot cost, which shouldn't show up on
anyone's radar.

Cc: Jay Chen <jkchen@linux.alibaba.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Link: https://lore.kernel.org/r/20211216190315.GA14220@lpieralisi
Link: https://lore.kernel.org/r/20220124133809.1291195-1-maz@kernel.org
drivers/irqchip/irq-gic-v3-its.c