Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1937663ybg; Sun, 27 Oct 2019 07:47:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqxwoHRYzSl3ObFDAcz2O/NSOExlVBSwEwOdlQkpfQ30Kern0uwAwzRdK06OIHPanKXJ0Tmg X-Received: by 2002:a50:eacc:: with SMTP id u12mr14762387edp.290.1572187658245; Sun, 27 Oct 2019 07:47:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572187658; cv=none; d=google.com; s=arc-20160816; b=vcgesoSfEJcoVuAr8OgLkD36qf8rruC9cLBfF21Z2WhLMgt8A9k5wrDVqzxPOZ/FvD 48ixYCttm0HOxyQi4hevayXbeLrTjlDwm9F/Bfqqum0tamcKnoVmssrk7JKuaUzhhz+f AvFYkxtifX4olGOK/oHagasbD3CiBZWegrHXPq8ht9mHr6tI2gEskMumSv4kxikx4v1z F7S2BqTcX4+l3N7cPvODO1U3AAuRQf+6+xWAbcJWt72QkxOPOj4GIyn5BugZqsGqwGCm EqNjWX8jqJj9DF6crx3MC8EuRAyRSd/DzHVry9WGC6Wgdo6dATsFOoRTOA9fCR8s2DVQ hIZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=T8FBwnoZsmjpli3RNm1qAJTeQNSeRp6eHDuuZjroQXE=; b=zOqK20i20pHib+zkepuHWfZ8Vc3m5snpwfnngdEIykWePvTvPk+L1bQTgwy3U6AJQM ARSLAJUVrEnFKO4Wwlchlpl4DFKi7M7B/+g74/r/ztWZeDy/NX1SgpvorQmXvSfg06Er I9mvNg4u3Vx3EJBcj+MavBO+SfdQiEMzuqaeUurPjJZOxnc8oduTXpi2V1ybf/lWb2II Y2t9tK1oBcXNCPUO/lqBIhAyM8mnkM1adIMLo6D7y2YztiDDx+iRQDRRlpLKaJ3sC8A1 tKA5UvNOeGC14EZhi0VQ2+YB40cEcrUZxHUC0c6aVfto9tp8BGLZUhjBGXrDFr6LvTK3 S9GQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="Y/cnvDdk"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h3si5317014edd.54.2019.10.27.07.47.14; Sun, 27 Oct 2019 07:47:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="Y/cnvDdk"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727260AbfJ0Ood (ORCPT + 99 others); Sun, 27 Oct 2019 10:44:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:37700 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726944AbfJ0Oob (ORCPT ); Sun, 27 Oct 2019 10:44:31 -0400 Received: from localhost.localdomain (82-132-239-15.dab.02.net [82.132.239.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BB36621E6F; Sun, 27 Oct 2019 14:44:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572187470; bh=wvraHwVr8++hSr5kwJalnecU6a8VgNiBf6HxT+p5zVw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y/cnvDdkvx2avkzyyBqeJhT++Z3O8boXc5+ThuwCsZm0GnNkB9SVLsvewFzNB8gbp 0Mx03Wd3SqNhEH0bpccraYFtotiC9pu0rSaGHzkuNVpdNKJe+RSbW9FChFq39eroGI Yf5WDMQDiFYvw5WdwprWGWTOEnCSVGBhHEmqo654= From: Marc Zyngier To: kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org Cc: Eric Auger , James Morse , Julien Thierry , Suzuki K Poulose , Thomas Gleixner , Jason Cooper , Lorenzo Pieralisi , Andrew Murray , Zenghui Yu , Jayachandran C , Robert Richter Subject: [PATCH v2 13/36] irqchip/gic-v4.1: Don't use the VPE proxy if RVPEID is set Date: Sun, 27 Oct 2019 14:42:11 +0000 Message-Id: <20191027144234.8395-14-maz@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191027144234.8395-1-maz@kernel.org> References: <20191027144234.8395-1-maz@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/irqchip/irq-gic-v3-its.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index 220d490d516e..999e61a9b2c3 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -3069,7 +3069,7 @@ static const struct irq_domain_ops its_domain_ops = { /* * This is insane. * - * If a GICv4 doesn't implement Direct LPIs (which is extremely + * If a GICv4.0 doesn't implement Direct LPIs (which is extremely * likely), the only way to perform an invalidate is to use a fake * device to issue an INV command, implying that the LPI has first * been mapped to some event on that device. Since this is not exactly @@ -3077,9 +3077,18 @@ static const struct irq_domain_ops its_domain_ops = { * only issue an UNMAP if we're short on available slots. * * Broken by design(tm). + * + * GICv4.1 actually mandates that we're able to invalidate by writing to a + * MMIO register. It doesn't implement the whole of DirectLPI, but that's + * good enough. And most of the time, we don't even have to invalidate + * anything, so that's actually pretty good! */ static void its_vpe_db_proxy_unmap_locked(struct its_vpe *vpe) { + /* GICv4.1 doesn't use a proxy, so nothing to do here */ + if (gic_rdists->has_rvpeid) + return; + /* Already unmapped? */ if (vpe->vpe_proxy_event == -1) return; @@ -3102,6 +3111,10 @@ static void its_vpe_db_proxy_unmap_locked(struct its_vpe *vpe) static void its_vpe_db_proxy_unmap(struct its_vpe *vpe) { + /* GICv4.1 doesn't use a proxy, so nothing to do here */ + if (gic_rdists->has_rvpeid) + return; + if (!gic_rdists->has_direct_lpi) { unsigned long flags; @@ -3113,6 +3126,10 @@ static void its_vpe_db_proxy_unmap(struct its_vpe *vpe) static void its_vpe_db_proxy_map_locked(struct its_vpe *vpe) { + /* GICv4.1 doesn't use a proxy, so nothing to do here */ + if (gic_rdists->has_rvpeid) + return; + /* Already mapped? */ if (vpe->vpe_proxy_event != -1) return; @@ -3135,6 +3152,10 @@ static void its_vpe_db_proxy_move(struct its_vpe *vpe, int from, int to) unsigned long flags; struct its_collection *target_col; + /* GICv4.1 doesn't use a proxy, so nothing to do here */ + if (gic_rdists->has_rvpeid) + return; + if (gic_rdists->has_direct_lpi) { void __iomem *rdbase; -- 2.20.1