irqchip/gic-v4.1: Ensure accessing the correct RD when writing INVALLR
authorZenghui Yu <yuzenghui@huawei.com>
Mon, 20 Jul 2020 09:23:28 +0000 (17:23 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Aug 2020 11:07:25 +0000 (13:07 +0200)
commit2c0ac43a7eb2525d683a2167b6b0c9a49611638d
tree811cbdfea6f9fd9abf60df2fbf2c093a2143982c
parent79b265a75c69be632033802298eac3ea46fc541f
irqchip/gic-v4.1: Ensure accessing the correct RD when writing INVALLR

commit 3af9571cd585efafc2facbd8dbd407317ff898cf upstream.

The GICv4.1 spec tells us that it's CONSTRAINED UNPREDICTABLE to issue a
register-based invalidation operation for a vPEID not mapped to that RD,
or another RD within the same CommonLPIAff group.

To follow this rule, commit f3a059219bc7 ("irqchip/gic-v4.1: Ensure mutual
exclusion between vPE affinity change and RD access") tried to address the
race between the RD accesses and the vPE affinity change, but somehow
forgot to take GICR_INVALLR into account. Let's take the vpe_lock before
evaluating vpe->col_idx to fix it.

Fixes: f3a059219bc7 ("irqchip/gic-v4.1: Ensure mutual exclusion between vPE affinity change and RD access")
Signed-off-by: Zenghui Yu <yuzenghui@huawei.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20200720092328.708-1-yuzenghui@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/irqchip/irq-gic-v3-its.c