Skip to content

Commit ec4308e

Browse files
ouptonKAGA-KOKO
authored andcommitted
irqchip/gic-v3-its: Do not assume vPE tables are preallocated
The GIC/ITS code is designed to ensure to pick up any preallocated LPI tables on the redistributors, as enabling LPIs is a one-way switch. There is no such restriction for vLPIs, and for GICv4.1 it is expected to allocate a new vPE table at boot. This works as intended when initializing an ITS, however when setting up a redistributor in cpu_init_lpis() the early return for preallocated RD tables skips straight past the GICv4 setup. This all comes to a head when trying to kexec() into a new kernel, as the new kernel silently fails to set up GICv4, leading to a complete loss of SGIs and LPIs for KVM VMs. Slap a band-aid on the problem by ensuring its_cpu_init_lpis() always initializes GICv4 on the way out, even if the other RD tables were preallocated. Fixes: 6479450 ("irqchip/gic-v4: Fix occasional VLPI drop") Reported-by: George Cherian <gcherian@marvell.com> Co-developed-by: Marc Zyngier <maz@kernel.org> Signed-off-by: Marc Zyngier <maz@kernel.org> Signed-off-by: Oliver Upton <oliver.upton@linux.dev> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20240219185809.286724-2-oliver.upton@linux.dev
1 parent fb33a46 commit ec4308e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/irqchip/irq-gic-v3-its.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3181,6 +3181,7 @@ static void its_cpu_init_lpis(void)
31813181
val |= GICR_CTLR_ENABLE_LPIS;
31823182
writel_relaxed(val, rbase + GICR_CTLR);
31833183

3184+
out:
31843185
if (gic_rdists->has_vlpis && !gic_rdists->has_rvpeid) {
31853186
void __iomem *vlpi_base = gic_data_rdist_vlpi_base();
31863187

@@ -3216,7 +3217,6 @@ static void its_cpu_init_lpis(void)
32163217

32173218
/* Make sure the GIC has seen the above */
32183219
dsb(sy);
3219-
out:
32203220
gic_data_rdist()->flags |= RD_LOCAL_LPI_ENABLED;
32213221
pr_info("GICv3: CPU%d: using %s LPI pending table @%pa\n",
32223222
smp_processor_id(),

0 commit comments

Comments
 (0)