Skip to content

Commit 79a7f77

Browse files
author
Marc Zyngier
committed
irqchip/gic-v4: Disable redistributors' view of the VPE table at boot time
Jay Chen reported that using a kdump kernel on a GICv4.1 system results in a RAS error being delivered when the secondary kernel configures the ITS's view of the new VPE table. As it turns out, that's because each RD still has a pointer to the previous instance of the VPE table, and that particular implementation is very upset by seeing two bits of the HW that should point to the same table with different values. To solve this, let's invalidate any reference that any RD has to the VPE table when discovering the RDs. The ITS can then be programmed as expected. Reported-by: Jay Chen <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Cc: Lorenzo Pieralisi <[email protected]> Link: https://lore.kernel.org/r/[email protected] Link: https://lore.kernel.org/r/[email protected]
1 parent 0859bbb commit 79a7f77

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

drivers/irqchip/irq-gic-v3.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -920,6 +920,22 @@ static int __gic_update_rdist_properties(struct redist_region *region,
920920
{
921921
u64 typer = gic_read_typer(ptr + GICR_TYPER);
922922

923+
/* Boot-time cleanip */
924+
if ((typer & GICR_TYPER_VLPIS) && (typer & GICR_TYPER_RVPEID)) {
925+
u64 val;
926+
927+
/* Deactivate any present vPE */
928+
val = gicr_read_vpendbaser(ptr + SZ_128K + GICR_VPENDBASER);
929+
if (val & GICR_VPENDBASER_Valid)
930+
gicr_write_vpendbaser(GICR_VPENDBASER_PendingLast,
931+
ptr + SZ_128K + GICR_VPENDBASER);
932+
933+
/* Mark the VPE table as invalid */
934+
val = gicr_read_vpropbaser(ptr + SZ_128K + GICR_VPROPBASER);
935+
val &= ~GICR_VPROPBASER_4_1_VALID;
936+
gicr_write_vpropbaser(val, ptr + SZ_128K + GICR_VPROPBASER);
937+
}
938+
923939
gic_data.rdists.has_vlpis &= !!(typer & GICR_TYPER_VLPIS);
924940

925941
/* RVPEID implies some form of DirectLPI, no matter what the doc says... :-/ */

0 commit comments

Comments
 (0)