Re: [PATCH v3 04/14] irqchip/gic-v5: Retain the L2 IST when mapping times out

From: Lorenzo Pieralisi

Date: Thu Nov 19 2026 - 08:32:49 EST


On Thu, Nov 19, 2026 at 12:00:15PM +0000, Fuad Tabba wrote:
> Hi Sascha,
>
> On Wed, 18 Nov 2026 17:35:33 +0000, Sascha Bischoff
> <sascha.bischoff@xxxxxxx> wrote:
> [...]
> > diff --git a/drivers/irqchip/irq-gic-v5-irs.c b/drivers/irqchip/irq-gic-v5-irs.c
> [...]
> > @@ -217,6 +217,10 @@ int gicv5_irs_iste_alloc(const u32 lpi)
> > if (FIELD_GET(GICV5_ISTL1E_VALID, le64_to_cpu(l1ist[index])))
> > return 0;
> >
> > + /* A previous map timed out; do not overwrite its pending L1 entry. */
> > + if (READ_ONCE(l1ist[index]))
> > + return -EBUSY;
>
> Sashiko's review [1] didn't go on the list, in case you missed it.
> Sashiko found that l1ist[index] is read twice, and that on a

Yes, we should read it once but see below.

> non-coherent IRS a map completing after the timeout leaves a stale
> copy of the L1 entry in the cache for later allocations. Invalidating
> the entry before it's first read would fix the latter. Invalidating it
> on the timeout path wouldn't, since a later read can refill the line
> before the map completes.

Well, we don't know when the map completes do we ? Is invalidating
just before it is READ_ONCE() really "fixing" this (actually, is what
we are trying to do minimizing the false negatives ie l1 entries
that we wrote and became valid that we would detect as not valid ?)
or we need to sync the IRS and check for idle before the invalidation ?

I will give it more thought - I don't like this complexity much for
basically fixing a very close to fatal error.

Thanks,
Lorenzo

> With those fixed:
> Reviewed-by: Fuad Tabba <fuad.tabba@xxxxxxxxx>
>
> Cheers,
> /fuad
>
> [1] https://sashiko.dev/#/patchset/20261118-host_gicv5_fixes-v3-0-13c1859e8aa3%40arm.com