Skip to content

Commit 0684c70

Browse files
author
Marc Zyngier
committed
irqchip/gic-v4.1: Don't use the VPE proxy if RVPEID is set
The infamous VPE proxy device isn't used with GICv4.1 because: - we can invalidate any LPI from the DirectLPI MMIO interface - the ITS and redistributors understand the life cycle of the doorbell, so we don't need to enable/disable it all the time So let's escape early from the proxy related functions. Signed-off-by: Marc Zyngier <[email protected]> Reviewed-by: Zenghui Yu <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 64edfaa commit 0684c70

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

drivers/irqchip/irq-gic-v3-its.c

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3212,17 +3212,28 @@ static const struct irq_domain_ops its_domain_ops = {
32123212
/*
32133213
* This is insane.
32143214
*
3215-
* If a GICv4 doesn't implement Direct LPIs (which is extremely
3215+
* If a GICv4.0 doesn't implement Direct LPIs (which is extremely
32163216
* likely), the only way to perform an invalidate is to use a fake
32173217
* device to issue an INV command, implying that the LPI has first
32183218
* been mapped to some event on that device. Since this is not exactly
32193219
* cheap, we try to keep that mapping around as long as possible, and
32203220
* only issue an UNMAP if we're short on available slots.
32213221
*
32223222
* Broken by design(tm).
3223+
*
3224+
* GICv4.1, on the other hand, mandates that we're able to invalidate
3225+
* by writing to a MMIO register. It doesn't implement the whole of
3226+
* DirectLPI, but that's good enough. And most of the time, we don't
3227+
* even have to invalidate anything, as the redistributor can be told
3228+
* whether to generate a doorbell or not (we thus leave it enabled,
3229+
* always).
32233230
*/
32243231
static void its_vpe_db_proxy_unmap_locked(struct its_vpe *vpe)
32253232
{
3233+
/* GICv4.1 doesn't use a proxy, so nothing to do here */
3234+
if (gic_rdists->has_rvpeid)
3235+
return;
3236+
32263237
/* Already unmapped? */
32273238
if (vpe->vpe_proxy_event == -1)
32283239
return;
@@ -3245,6 +3256,10 @@ static void its_vpe_db_proxy_unmap_locked(struct its_vpe *vpe)
32453256

32463257
static void its_vpe_db_proxy_unmap(struct its_vpe *vpe)
32473258
{
3259+
/* GICv4.1 doesn't use a proxy, so nothing to do here */
3260+
if (gic_rdists->has_rvpeid)
3261+
return;
3262+
32483263
if (!gic_rdists->has_direct_lpi) {
32493264
unsigned long flags;
32503265

@@ -3256,6 +3271,10 @@ static void its_vpe_db_proxy_unmap(struct its_vpe *vpe)
32563271

32573272
static void its_vpe_db_proxy_map_locked(struct its_vpe *vpe)
32583273
{
3274+
/* GICv4.1 doesn't use a proxy, so nothing to do here */
3275+
if (gic_rdists->has_rvpeid)
3276+
return;
3277+
32593278
/* Already mapped? */
32603279
if (vpe->vpe_proxy_event != -1)
32613280
return;
@@ -3278,6 +3297,10 @@ static void its_vpe_db_proxy_move(struct its_vpe *vpe, int from, int to)
32783297
unsigned long flags;
32793298
struct its_collection *target_col;
32803299

3300+
/* GICv4.1 doesn't use a proxy, so nothing to do here */
3301+
if (gic_rdists->has_rvpeid)
3302+
return;
3303+
32813304
if (gic_rdists->has_direct_lpi) {
32823305
void __iomem *rdbase;
32833306

0 commit comments

Comments
 (0)