[RFC PATCH] irqchip/gic-v4.1:fix the kdump GIC ITS RAS error for ITS BASER2

From: Jay Chen
Date: Tue Dec 14 2021 - 01:47:31 EST


We encounter a GIC RAS Error in below flow:
(1) Configure ITS related register (including
GITS_BASER2, GITS_BASER2.valid = 1'b1)
(2) Configure GICR related register (including
GICR_VPROPBASER, GICR_VPROPBASER.valid = 1'b1)
The common settings in above 2 register are the same
and currently everything is OK
(3) Kernel panic and os start the kdump flow.And then os
reconfigure ITS related register (including GITS_BASER2,
GITS_BASER2.valid = 1'b1). But at this time, gicr_vpropbaser
is not initialized, so it is still an old value. At this point,
the new value of its_baser2 and the old value of gicr_vpropbaser is
different, resulting in its RAS error.

https://bugzilla.kernel.org/show_bug.cgi?id=215327

Signed-off-by: Jay Chen <jkchen@xxxxxxxxxxxxxxxxx>
---
drivers/irqchip/irq-gic-v3-its.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
index eb0882d15366..c340bbf4427b 100644
--- a/drivers/irqchip/irq-gic-v3-its.c
+++ b/drivers/irqchip/irq-gic-v3-its.c
@@ -2623,6 +2623,12 @@ static int its_alloc_tables(struct its_node *its)
return err;
}

+ if ((i == 2) && is_kdump_kernel() && is_v4_1(its)) {
+ val = its_read_baser(its, baser);
+ val &= ~GITS_BASER_VALID;
+ its_write_baser(its, baser, val);
+ }
+
/* Update settings which will be used for next BASERn */
cache = baser->val & GITS_BASER_CACHEABILITY_MASK;
shr = baser->val & GITS_BASER_SHAREABILITY_MASK;
--
2.27.0