Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp975176ybl; Fri, 24 Jan 2020 13:02:10 -0800 (PST) X-Google-Smtp-Source: APXvYqwQP+lqiUh0IrvTQDpSTIjXHiahQoHBt3p4rD0e7xw/xf50ns37J39CQUkOEkvOV19U5G4v X-Received: by 2002:a05:6830:1e86:: with SMTP id n6mr425344otr.321.1579899730024; Fri, 24 Jan 2020 13:02:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579899730; cv=none; d=google.com; s=arc-20160816; b=QdG2wzb1ItPHsktOqrF1nDkx+5YF4/XYvNSMlUNhBquAkQrUWRE+uMbO1ji9ddQONk cWm7qWIhNLR6LTMMMGp5nD2TarxDz3GOp/+regyRIj5bmKWnonVbk0KLG/Bj6cpYOUXp f0IOZxXSOor1SjRt/Hvs7IX0aMjoktRu8AXT0NHA9pus3jEboOBrvU9fwDsf8FzsnhDB 0iYZcOCoxcHmvyE3q/RGARNjDzwtmLnisFGw9j9WuS192OYKlNDijClUMx3l+1gumN/E XQOacRy3DRkw8zX5BOalyNYiNj/SRNiHwJOFdVn1CFA+UchGF6ZGQzYT91wVKMm25F8I MYQQ== 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 :robot-unsubscribe:robot-id:message-id:mime-version:references :in-reply-to:cc:subject:to:reply-to:from:date; bh=bZSt3I/WTufbqKJLnHQfmwJBHgssxTxWDM/m1FUw/OU=; b=SHP2KsO6M4dmpOlY2EU+SybC3KH9eMrBSAgt1vxHlyoYJ0H4hWBKtj9uyXM632TztR 7NZnkr9Xx2LDk0lfXg8CgOrWFjTbg48PifsQp//16QsoqihpSRhHkWZszv0k0Ypf7D9u vzHg+hNw4e0g2hDG9TxuOdW+5DmSuTRtQN96KPvrPT1CgEMGCsonvBk1SKjw4HZhXWsN 9tB5UBgApP7SF3Hp60uz7q/7dU96EfDWbYSbAb4sc1VdJ7MdJrzAqIt7b9FE2eksMJoB iWRx509dZJD/FnbCFdCTDooqfBb9M9tK5K3AkKX80hYye5RRtTebnm4339kRaLB96T58 np+A== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e15si1725426ote.211.2020.01.24.13.01.57; Fri, 24 Jan 2020 13:02:10 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403982AbgAXTLR (ORCPT + 99 others); Fri, 24 Jan 2020 14:11:17 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:43009 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403948AbgAXTLP (ORCPT ); Fri, 24 Jan 2020 14:11:15 -0500 Received: from [5.158.153.53] (helo=tip-bot2.lab.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1iv4MJ-0007cM-M1; Fri, 24 Jan 2020 20:11:11 +0100 Received: from [127.0.1.1] (localhost [IPv6:::1]) by tip-bot2.lab.linutronix.de (Postfix) with ESMTP id C5F941C1A60; Fri, 24 Jan 2020 20:11:09 +0100 (CET) Date: Fri, 24 Jan 2020 19:11:09 -0000 From: "tip-bot2 for Marc Zyngier" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: irq/core] irqchip/gic-v3: Detect GICv4.1 supporting RVPEID Cc: Marc Zyngier , Zenghui Yu , x86 , LKML In-Reply-To: <20191224111055.11836-2-maz@kernel.org> References: <20191224111055.11836-2-maz@kernel.org> MIME-Version: 1.0 Message-ID: <157989306961.396.14563864027491981726.tip-bot2@tip-bot2> X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the irq/core branch of tip: Commit-ID: b25319d279b63781b972c4966b4082193e69afac Gitweb: https://git.kernel.org/tip/b25319d279b63781b972c4966b4082193e69afac Author: Marc Zyngier AuthorDate: Tue, 24 Dec 2019 11:10:24 Committer: Marc Zyngier CommitterDate: Wed, 22 Jan 2020 14:22:19 irqchip/gic-v3: Detect GICv4.1 supporting RVPEID GICv4.1 supports the RVPEID ("Residency per vPE ID"), which allows for a much efficient way of making virtual CPUs resident (to allow direct injection of interrupts). The functionnality needs to be discovered on each and every redistributor in the system, and disabled if the settings are inconsistent. Signed-off-by: Marc Zyngier Reviewed-by: Zenghui Yu Link: https://lore.kernel.org/r/20191224111055.11836-2-maz@kernel.org --- drivers/irqchip/irq-gic-v3.c | 21 ++++++++++++++++++--- include/linux/irqchip/arm-gic-v3.h | 2 ++ 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index d621801..ffcb018 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -858,8 +858,21 @@ static int __gic_update_rdist_properties(struct redist_region *region, void __iomem *ptr) { u64 typer = gic_read_typer(ptr + GICR_TYPER); + gic_data.rdists.has_vlpis &= !!(typer & GICR_TYPER_VLPIS); - gic_data.rdists.has_direct_lpi &= !!(typer & GICR_TYPER_DirectLPIS); + + /* RVPEID implies some form of DirectLPI, no matter what the doc says... :-/ */ + gic_data.rdists.has_rvpeid &= !!(typer & GICR_TYPER_RVPEID); + gic_data.rdists.has_direct_lpi &= (!!(typer & GICR_TYPER_DirectLPIS) | + gic_data.rdists.has_rvpeid); + + /* Detect non-sensical configurations */ + if (WARN_ON_ONCE(gic_data.rdists.has_rvpeid && !gic_data.rdists.has_vlpis)) { + gic_data.rdists.has_direct_lpi = false; + gic_data.rdists.has_vlpis = false; + gic_data.rdists.has_rvpeid = false; + } + gic_data.ppi_nr = min(GICR_TYPER_NR_PPIS(typer), gic_data.ppi_nr); return 1; @@ -872,9 +885,10 @@ static void gic_update_rdist_properties(void) if (WARN_ON(gic_data.ppi_nr == UINT_MAX)) gic_data.ppi_nr = 0; pr_info("%d PPIs implemented\n", gic_data.ppi_nr); - pr_info("%sVLPI support, %sdirect LPI support\n", + pr_info("%sVLPI support, %sdirect LPI support, %sRVPEID support\n", !gic_data.rdists.has_vlpis ? "no " : "", - !gic_data.rdists.has_direct_lpi ? "no " : ""); + !gic_data.rdists.has_direct_lpi ? "no " : "", + !gic_data.rdists.has_rvpeid ? "no " : ""); } /* Check whether it's single security state view */ @@ -1566,6 +1580,7 @@ static int __init gic_init_bases(void __iomem *dist_base, &gic_data); irq_domain_update_bus_token(gic_data.domain, DOMAIN_BUS_WIRED); gic_data.rdists.rdist = alloc_percpu(typeof(*gic_data.rdists.rdist)); + gic_data.rdists.has_rvpeid = true; gic_data.rdists.has_vlpis = true; gic_data.rdists.has_direct_lpi = true; diff --git a/include/linux/irqchip/arm-gic-v3.h b/include/linux/irqchip/arm-gic-v3.h index de991d6..9a5f85d 100644 --- a/include/linux/irqchip/arm-gic-v3.h +++ b/include/linux/irqchip/arm-gic-v3.h @@ -234,6 +234,7 @@ #define GICR_TYPER_VLPIS (1U << 1) #define GICR_TYPER_DirectLPIS (1U << 3) #define GICR_TYPER_LAST (1U << 4) +#define GICR_TYPER_RVPEID (1U << 7) #define GIC_V3_REDIST_SIZE 0x20000 @@ -615,6 +616,7 @@ struct rdists { u64 flags; u32 gicd_typer; bool has_vlpis; + bool has_rvpeid; bool has_direct_lpi; };