Re: [PATCH v4 09/13] irqchip/gic-v5: Clean the allocated linear device table size
From: Fuad Tabba
Date: Wed Dec 02 2026 - 08:35:28 EST
Hi Sascha,
On Wed, 25 Nov 2026 14:40:31 +0000, Sascha Bischoff
<sascha.bischoff@xxxxxxx> wrote:
> When the linear device table exceeds the kmalloc limit, the driver
> caps the DeviceID width before allocation but keeps the original size
> for cache maintenance. On a noncoherent ITS, this cleans beyond the
> allocated table.
>
> Recalculate the size after capping the DeviceID width.
>
> Fixes: 57d72196dfc85 ("irqchip/gic-v5: Add GICv5 ITS support")
> Signed-off-by: Sascha Bischoff <sascha.bischoff@xxxxxxx>
> Acked-by: Lorenzo Pieralisi <lpieralisi@xxxxxxxxxx>
> Cc: stable@xxxxxxxxxxxxxxx
[...]
> diff --git a/drivers/irqchip/irq-gic-v5-its.c b/drivers/irqchip/irq-gic-v5-its.c
[...]
> @@ -594,14 +594,14 @@ static int gicv5_its_alloc_devtab_linear(struct gicv5_its_chip_data *its,
> * kmalloc limits so that the system can chug along with a linear
> * device table.
> */
> - sz = BIT_ULL(device_id_bits) * sizeof(*devtab);
> - if (sz > KMALLOC_MAX_SIZE) {
> - u8 device_id_cap = ilog2(KMALLOC_MAX_SIZE/sizeof(*devtab));
> + if (BIT_ULL(device_id_bits) * sizeof(*devtab) > KMALLOC_MAX_SIZE) {
> + u8 device_id_cap = ilog2(KMALLOC_MAX_SIZE / sizeof(*devtab));
nit: the device_id_cap line only changes whitespace. Better left out
of stable fix?
Reviewed-by: Fuad Tabba <fuad.tabba@xxxxxxxxx>
Cheers,
/fuad