[PATCH v4 09/13] irqchip/gic-v5: Clean the allocated linear device table size

Fuad Tabba fuad.tabba at linux.dev
Wed Dec 2 05:34:38 PST 2026


Hi Sascha,

On Wed, 25 Nov 2026 14:40:31 +0000, Sascha Bischoff
<sascha.bischoff at arm.com> 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 at arm.com>
> Acked-by: Lorenzo Pieralisi <lpieralisi at kernel.org>
> Cc: stable at vger.kernel.org
[...]
> 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 at linux.dev>

Cheers,
/fuad



More information about the linux-arm-kernel mailing list