From patchwork Wed Oct 14 11:12:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 11837513 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EE7E614B3 for ; Wed, 14 Oct 2020 11:13:15 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A36E020878 for ; Wed, 14 Oct 2020 11:13:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="1w2s7d1F"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="MMQn1HxA" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A36E020878 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:To: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=usDlyfKeuC1q1TshcvQAE/StbbV/kG86F58Axtd8lF8=; b=1w2s7d1FL16sRHEg+iSnqR407t WDdquhF6Cb96vM77aETGRIbyzAbsH7OLL6B4u3A2c0j81qdBXC2ASy57GwEQ2iaH6I9RYjGCYSu9k 3M1YdQq4bHWvwP5/eAXJMvLTY4T+fbmItpnpneDpOWn2vrfq6KBRWWKrfvqyqTbV3rx8UVKolSoqE RVMmy0diPtHnjJ+RgFfO+dhijWE45/1QiRzY3zeZ3ez6YYu3ld+ozRgkbEl4XCL+G0Rs5W1m6ckMV UE8IeW2fIPGoR2WY8d9CFNE6WPjBWlU9tCNM/wiH1kxUQd0naYy97M35FxQU3zp8A7bYTvADgfvPT bK0CB63Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kSeiM-0005Uf-GJ; Wed, 14 Oct 2020 11:13:02 +0000 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kSeiI-0005TW-Qv for linux-arm-kernel@lists.infradead.org; Wed, 14 Oct 2020 11:13:00 +0000 Received: by mail-pg1-x544.google.com with SMTP id y14so1722556pgf.12 for ; Wed, 14 Oct 2020 04:12:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=SKgoeb2sQC7EsxoClVm7L3B4m5FY4cggAP6CyWZ0QJ4=; b=MMQn1HxAw/5HZN6E99ENJxg+pIPfiiKZv5G5Rl2fkTznbb5Dj8uynfA8lYT7tDLiZ7 Ay8vBQvah6h4kxUV1R1aZ9oEkvKGj/bzq82P2YdtNeBcvvyNU6Mfq5vBCmGJkHLw9JEB DXPYph8KS9RzenPcuN5hjykrPD7W4PaFqVZitmYZI75OTsrIgroCRkF4/YdMi+cHcWLm ocPAwexfm0MAO8Dg7X6zSsb2WleF7rmz3j2i9DnH2bM9zUYRdi/CrkwBnuDcjkrnMoHi u/BwCXEpHRMqLX6FpyiJeO/bhtzozc5oQorwcwenTeLWenwMjk4FXaZaBJSzyDEn4E1G hPrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=SKgoeb2sQC7EsxoClVm7L3B4m5FY4cggAP6CyWZ0QJ4=; b=iRVZJKkCn8Q3rgC2T0uoxx3y33bXWQnL5IFnd0QLoogmOQwHYcGFV+KPoBbIBDXz26 bLfZ8DsV3RmDv/QLBM+ZhF/3i2lna8USqYoTeGnHuhBD+yQAXF6CuprntG/xyY6BV0RX izVWLSnqkwXZaFp1q1mJ/KEdnmx0hsQlzSwwnKaOr7sjjkYENy/txgHI7NmFXRAYyWvz fkBopJ70H/r4/Z7MhL3coJEs05By84mHTTPRB7cC+3wfM+tW+9C9Er+CpQA2kWSCjdAz 78IxsTpQ9ZcSq+1OEna2EjjIl3/iTLSRCfIn/NFpA7UEI8E6yam2msKbepiiLNHOcg9t WvUw== X-Gm-Message-State: AOAM5313C6F09r86Cd9AsoOyuUEGnaQboDPKKPoMGbmJC9HxH9L9Al9c x+gEMXyND58odH2erUr5237BRw== X-Google-Smtp-Source: ABdhPJwvoPqSTeDCjNjszJCXG1jgM+7fBedU3mgHJpvhE8Qr2Y4Y8e/gDZVOKFSpCznoGmJn4ALIyg== X-Received: by 2002:a63:e44b:: with SMTP id i11mr3523192pgk.431.1602673976593; Wed, 14 Oct 2020 04:12:56 -0700 (PDT) Received: from localhost.localdomain ([117.252.65.235]) by smtp.gmail.com with ESMTPSA id f21sm3060102pfk.169.2020.10.14.04.12.49 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Oct 2020 04:12:55 -0700 (PDT) From: Sumit Garg To: maz@kernel.org, catalin.marinas@arm.com, will@kernel.org Subject: [PATCH v5 2/5] irqchip/gic-v3: Enable support for SGIs to act as NMIs Date: Wed, 14 Oct 2020 16:42:08 +0530 Message-Id: <1602673931-28782-3-git-send-email-sumit.garg@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1602673931-28782-1-git-send-email-sumit.garg@linaro.org> References: <1602673931-28782-1-git-send-email-sumit.garg@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201014_071258_940527_2A52F5AD X-CRM114-Status: GOOD ( 15.01 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:544 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, Sumit Garg , daniel.thompson@linaro.org, jason@lakedaemon.net, kgdb-bugreport@lists.sourceforge.net, ito-yuichi@fujitsu.com, dianders@chromium.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, jason.wessel@windriver.com, tglx@linutronix.de, msys.mizuma@gmail.com, julien.thierry.kdev@gmail.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add support to handle SGIs as regular NMIs. As SGIs or IPIs defaults to a special flow handler: handle_percpu_devid_fasteoi_ipi(), so skip NMI handler update in case of SGIs. Also, enable NMI support prior to gic_smp_init() as allocation of SGIs as IRQs/NMIs happen as part of this routine. Signed-off-by: Sumit Garg --- drivers/irqchip/irq-gic-v3.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index 16fecc0..5efc865 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -477,6 +477,11 @@ static int gic_irq_nmi_setup(struct irq_data *d) if (WARN_ON(gic_irq(d) >= 8192)) return -EINVAL; + if (get_intid_range(d) == SGI_RANGE) { + gic_irq_set_prio(d, GICD_INT_NMI_PRI); + return 0; + } + /* desc lock should already be held */ if (gic_irq_in_rdist(d)) { u32 idx = gic_get_ppi_index(d); @@ -514,6 +519,11 @@ static void gic_irq_nmi_teardown(struct irq_data *d) if (WARN_ON(gic_irq(d) >= 8192)) return; + if (get_intid_range(d) == SGI_RANGE) { + gic_irq_set_prio(d, GICD_INT_DEF_PRI); + return; + } + /* desc lock should already be held */ if (gic_irq_in_rdist(d)) { u32 idx = gic_get_ppi_index(d); @@ -1708,6 +1718,7 @@ static int __init gic_init_bases(void __iomem *dist_base, gic_dist_init(); gic_cpu_init(); + gic_enable_nmi_support(); gic_smp_init(); gic_cpu_pm_init(); @@ -1719,8 +1730,6 @@ static int __init gic_init_bases(void __iomem *dist_base, gicv2m_init(handle, gic_data.domain); } - gic_enable_nmi_support(); - return 0; out_free: