Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp7469881ybl; Tue, 24 Dec 2019 03:12:51 -0800 (PST) X-Google-Smtp-Source: APXvYqwQal1+bixx3NTFvGLRJ8OpNBSLkoPxnTeS+60i6F8DvTY2YXrLZoSDheFNLb76kHVwlLA0 X-Received: by 2002:a9d:630d:: with SMTP id q13mr35829248otk.31.1577185971914; Tue, 24 Dec 2019 03:12:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577185971; cv=none; d=google.com; s=arc-20160816; b=K2P/wtxzEssOmLuhwVYQ/k2s+zUFEOxDZn70vBVfYrHrZGl8W48PeVFijiDDE+AwCp P1fmPK9dvVnEjIvdDDeoFxUDZ/3P+9PYqIorLgzCm5S8mg+KvddMP6RDBk9zWIXyTwQI nDHHlBY0xQHS65qEsoj56xW8t3qb4qK9YoTuIl3vxu0kfYi2t/ioSymODiDlc7om735b 7vITku1isVxU9E1ebTQxLxTzz4pg756CqLwBpw6lYxLT4AuulH5bPE9ZiycqAJBm/DNH yTqbYkl2+EskA8+Asc2iBbanxwlbP7YFD3+UHvOr0MxLahp3iUER0HJmzzHX/WyVaGph pp0w== 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; bh=h7xVyLqAEjRHFEqMb6HLQ5Z9mzzexzAqK2uzAi1eQAc=; b=dRdJUjdEzx1kM0l40syWoddSItJd3DKRy3CX56UOib6e33gP565i5TaSu6lRvfGxZR TLORWaBstmjesjeeWHW4EG5NAzLjE0B3U/hgNiyjcoZzl5Y5reMOsYtdQ1meBgDIM0A+ mVj8G+iFe3aMbTpGzV8r3/XZbEkFCbawM3w/XcCb9XboTlj9nG4LuF+CywpZ94dRCReo vGaojz52iIyVRdgCTBMdXoDoYhpQCQBayofAjmMQBpATRnC0jemg7GUbeluUzhE9N6iq YoN5KRRQobCDo0p5eElumjJQwtjPhK3HsU414/hbsaIDsb/136MK/eNRDdLmF3JGj4vE Hkag== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (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 m7si1849818oih.7.2019.12.24.03.12.41; Tue, 24 Dec 2019 03:12:51 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727071AbfLXLLh (ORCPT + 99 others); Tue, 24 Dec 2019 06:11:37 -0500 Received: from inca-roads.misterjones.org ([213.251.177.50]:50400 "EHLO inca-roads.misterjones.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726302AbfLXLLR (ORCPT ); Tue, 24 Dec 2019 06:11:17 -0500 Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=why.lan) by cheepnis.misterjones.org with esmtpsa (TLSv1.2:DHE-RSA-AES128-GCM-SHA256:128) (Exim 4.80) (envelope-from ) id 1iji5r-000169-Kr; Tue, 24 Dec 2019 12:11:16 +0100 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 , Robert Richter Subject: [PATCH v3 07/32] irqchip/gic-v4.1: Don't use the VPE proxy if RVPEID is set Date: Tue, 24 Dec 2019 11:10:30 +0000 Message-Id: <20191224111055.11836-8-maz@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191224111055.11836-1-maz@kernel.org> References: <20191224111055.11836-1-maz@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, eric.auger@redhat.com, james.morse@arm.com, julien.thierry.kdev@gmail.com, suzuki.poulose@arm.com, tglx@linutronix.de, jason@lakedaemon.net, lorenzo.pieralisi@arm.com, Andrew.Murray@arm.com, yuzenghui@huawei.com, rrichter@marvell.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on cheepnis.misterjones.org); SAEximRunCond expanded to false 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. Reviewed-by: Zenghui Yu Signed-off-by: Marc Zyngier --- drivers/irqchip/irq-gic-v3-its.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index e3c7d9ae0bdb..86c69b5cc156 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -3213,7 +3213,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 @@ -3221,9 +3221,20 @@ 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, on the other hand, 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, as the redistributor can be told + * whether to generate a doorbell or not (we thus leave it enabled, + * always). */ 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; @@ -3246,6 +3257,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; @@ -3257,6 +3272,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; @@ -3279,6 +3298,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