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: Lorenzo Pieralisi <lorenzo.pieralisi@xxxxxxx>
Cc: Jay Chen <jkchen@xxxxxxxxxxxxxxxxx>
Signed-off-by: Marc Zyngier <maz@xxxxxxxxxx>
Link: https://lore.kernel.org/r/20211216190315.GA14220@lpieralisi
---
Notes:
* From v1: Fail probing if any ITS fails to reset.
drivers/irqchip/irq-gic-v3-its.c | 111 +++++++++++++++++++++++++------
1 file changed, 92 insertions(+), 19 deletions(-)
static void __init its_acpi_probe(void)
{
acpi_table_parse_srat_its();
+ if (acpi_table_parse_madt(ACPI_MADT_TYPE_GENERIC_TRANSLATOR,
+ its_acpi_reset, 0))
+ return;