[PATCH v2 4/5] irqchip/gic-v3-its: Zero ITTs reused from the ITT pool
Marc Zyngier
maz at kernel.org
Mon Nov 23 05:01:07 PST 2026
On Mon, 16 Nov 2026 19:29:32 +0000,
Fuad Tabba <fuad.tabba at linux.dev> wrote:
>
> Commit b08e2f42e86b5 ("irqchip/gic-v3-its: Share ITS tables with a
> non-trusted hypervisor") moved sub-page ITTs from kzalloc_node() to a
> genpool. The pages added to the pool are zeroed, but an ITT freed back
> to it goes to the next device as the previous one left it. MAPD is then
> UNPREDICTABLE: "When V == 1, the specified ITT does not contain all
> zeros" (IHI 0069H.b, 5.3.10).
>
> Zero every ITT that comes from the pool.
>
> Fixes: b08e2f42e86b5 ("irqchip/gic-v3-its: Share ITS tables with a non-trusted hypervisor")
> Reviewed-by: Suzuki K Poulose <suzuki.poulose at arm.com>
> Signed-off-by: Fuad Tabba <fuad.tabba at linux.dev>
> ---
> drivers/irqchip/irq-gic-v3-its.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
> index 5756ffe4ec13e..33aa8a355ec65 100644
> --- a/drivers/irqchip/irq-gic-v3-its.c
> +++ b/drivers/irqchip/irq-gic-v3-its.c
> @@ -270,8 +270,10 @@ static void *itt_alloc_pool(int node, int size)
>
> do {
> addr = gen_pool_alloc(itt_pool, size);
> - if (addr)
> + if (addr) {
> + memset((void *)addr, 0, size);
> break;
> + }
>
> page = its_alloc_pages_node(node, GFP_KERNEL | __GFP_ZERO, 0);
> if (!page)
If we are going to zero every ITT that is dished out to the driver,
then there is no point in asking for the page to be zeroed the first
place, is it?
Thanks,
M.
--
Without deviation from the norm, progress is not possible.
More information about the linux-arm-kernel
mailing list