[PATCH v4 4/5] irqchip/gic-v3-its: Zero ITTs reused from the ITT pool
Fuad Tabba
fuad.tabba at linux.dev
Mon Nov 30 00:08:55 PST 2026
Commit b08e2f42e86b5 ("irqchip/gic-v3-its: Share ITS tables with a
non-trusted hypervisor") moved sub-page ITTs from kzalloc_node() to a
genpool. An ITT freed back to the pool 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. The ITS then no longer needs
the pages added to the pool zeroed, so drop __GFP_ZERO from their
allocation.
Fixes: b08e2f42e86b5 ("irqchip/gic-v3-its: Share ITS tables with a non-trusted hypervisor")
Reviewed-by: Suzuki K Poulose <suzuki.poulose at arm.com>
Reviewed-by: Zenghui Yu <yuzenghui at huawei.com>
Reviewed-by: Marc Zyngier <maz at kernel.org>
Signed-off-by: Fuad Tabba <fuad.tabba at linux.dev>
---
drivers/irqchip/irq-gic-v3-its.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
index 5756ffe4ec13e..6eb2dbec5f0ed 100644
--- a/drivers/irqchip/irq-gic-v3-its.c
+++ b/drivers/irqchip/irq-gic-v3-its.c
@@ -270,10 +270,12 @@ 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);
+ page = its_alloc_pages_node(node, GFP_KERNEL, 0);
if (!page)
break;
--
2.47.3
More information about the linux-arm-kernel
mailing list