Re: [PATCH v3 13/14] irqchip/gic-v5: Clean a level 2 device table before making it valid
From: Lorenzo Pieralisi
Date: Thu Nov 19 2026 - 05:19:35 EST
On Wed, Nov 18, 2026 at 05:35:42PM +0000, Sascha Bischoff wrote:
> From: Fuad Tabba <fuad.tabba@xxxxxxxxx>
>
> gicv5_its_alloc_l2_devtab() allocates a zeroed level 2 device table and
> writes the level 1 DTE that points to it with VALID set. Unlike the
> other ITS tables, the new table isn't cleaned to the PoC first. On a
> non-coherent ITS, the zeroes can still sit in the CPU caches when the
> ITS reads the table, so it can take stale memory as a valid level 2 DTE
> for a DeviceID that nothing has registered.
>
> Clean the table before the level 1 DTE is written.
>
> Fixes: 57d72196dfc85 ("irqchip/gic-v5: Add GICv5 ITS support")
> Signed-off-by: Fuad Tabba <fuad.tabba@xxxxxxxxx>
> Signed-off-by: Sascha Bischoff <sascha.bischoff@xxxxxxx>
> Cc: stable@xxxxxxxxxxxxxxx
> ---
> drivers/irqchip/irq-gic-v5-its.c | 2 ++
> 1 file changed, 2 insertions(+)
Acked-by: Lorenzo Pieralisi <lpieralisi@xxxxxxxxxx>
> diff --git a/drivers/irqchip/irq-gic-v5-its.c b/drivers/irqchip/irq-gic-v5-its.c
> index cfa86aa68bf3c..7fff2db9ae08e 100644
> --- a/drivers/irqchip/irq-gic-v5-its.c
> +++ b/drivers/irqchip/irq-gic-v5-its.c
> @@ -415,6 +415,8 @@ static int gicv5_its_alloc_l2_devtab(struct gicv5_its_chip_data *its,
> if (!l2devtab)
> return -ENOMEM;
>
> + gicv5_its_dcache_clean(its, l2devtab, BIT(span) * sizeof(*l2devtab));
> +
> its->devtab_cfgr.l2.l2ptrs[l1_index] = l2devtab;
>
> l1dte = FIELD_PREP(GICV5_DTL1E_SPAN, span) |
>
> --
> 2.34.1
>