Skip to content

Commit

Permalink
irqchip/gic-v4.1: Skip absent CPUs while iterating over redistributors
Browse files Browse the repository at this point in the history
In a system that is only sparsly populated with CPUs, we can end-up with
redistributors structures that are not initialized. Let's make sure we
don't try and access those when iterating over them (in this case when
checking we have a L2 VPE table).

Fixes: 4e6437f ("irqchip/gic-v4.1: Ensure L2 vPE table is allocated at RD level")
Signed-off-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Zenghui Yu <yuzenghui@huawei.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Link: https://lore.kernel.org/r/20200304203330.4967-3-maz@kernel.org
  • Loading branch information
Marc Zyngier committed Mar 19, 2020
1 parent 0b04758 commit 28d160d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/irqchip/irq-gic-v3-its.c
Original file line number Diff line number Diff line change
Expand Up @@ -2452,6 +2452,10 @@ static bool allocate_vpe_l2_table(int cpu, u32 id)
if (!gic_rdists->has_rvpeid)
return true;

/* Skip non-present CPUs */
if (!base)
return true;

val = gicr_read_vpropbaser(base + SZ_128K + GICR_VPROPBASER);

esz = FIELD_GET(GICR_VPROPBASER_4_1_ENTRY_SIZE, val) + 1;
Expand Down

0 comments on commit 28d160d

Please sign in to comment.