From patchwork Fri Sep 11 13:28:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 11770585 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 39888112E for ; Fri, 11 Sep 2020 13:32:18 +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 B285722273 for ; Fri, 11 Sep 2020 13:32:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="uKvqpqI3"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ICb2A4Q9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B285722273 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=5kooRih43fGm/t5U7Txg1kN8My9hDpqccPz6c8LVIE8=; b=uKvqpqI3/oI9CyJoRWwD2GJVBl yEUFxp/Xpmg54QAi4RKht+EBXAbrnINmMg177QzUQ+i/BHAMHtfbbtsgbmXvxaHTrJLeiKGidzV1l gI2FoLwK5JaL7TGUbw7PuVtAXuuBr0weJoV4xXGgJG394uY44WBpJ5GmCD7JQKM6AvUUC7RltYR// GD5ce5QUiNFwMUtMRBpYUIfpyoOu+cU7tmlUUAr3fEHmvXIctxGGR1msYUVJ/WUja5AeJKt5cu+Gh r1AHoKEW1d8sHQyjC6NNQYhLQRokUSxLFIN99ol4HniEooseiP0s61LOcdMyrip7GBc7oNifFDu0C ti1CEiag==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGj9a-0007vZ-Td; Fri, 11 Sep 2020 13:31:51 +0000 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGj7E-0006Xz-PJ for linux-arm-kernel@lists.infradead.org; Fri, 11 Sep 2020 13:29:26 +0000 Received: by mail-pf1-x443.google.com with SMTP id o20so7324536pfp.11 for ; Fri, 11 Sep 2020 06:29:24 -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=kqVh90gZA+Jv+sQxaZ1mzbNqmtA+iD77lIe6xdCdvDA=; b=ICb2A4Q92/WBWM7cefZ5ElnS+BfqFA5z0dbBB4/9D+x61pUUrWW1TIJyG5l2OJJ2J5 /b+lGtutItcjO/D7XmeVO8ZnVREF7WXLuAt2jwJvuvVcSsqEGPxbZ5u5LOpc00sQAHWj gfOC3DyGCrPI5E0Cm6J32sd1Nu8oGV5TOkQacP/WGNAa764VytHt7lu0brBvUxrFOvSa Pw5Mcyi2x9MbzUTws4bDmbU3LsDZxbaiPV+biUykE5780veIyiTyoc63274v3ZgtVsDG TyHyLH9q/0ALmh03yg/t0t0x4rf1uBE9MoH47bCmbU+IFZ52Te0Vqol1v32V9eODx1yV Smkw== 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=kqVh90gZA+Jv+sQxaZ1mzbNqmtA+iD77lIe6xdCdvDA=; b=uXMLEuV6qTgkUnYxC455KN6ywaMvcLP9qNU9MxKcy4ktEO2WxVBNVrhBumahbO68Nb DI/2EObZYHQUYuu1xv0ONAbMd+hwsTOqV5YMhmgFTB0EZbKQzb89D9RLse8q43RGAD5P fX9gw6bl40mV7iAtIdrjHprTVW05yllrH+A6ANXpl2GPaVUq03vxc1du9h3QOqix/0uR 3ZfOkrYqfOpKqYk+exlssxJKZdJ2A1W3vhwwILZlzK3R0fG064lmsgYeNbGdmqXR7zc4 SVGaU8HSQz1UIslkr+/bEzSWnEJUt/L4k5XxgCSUiqd8gDcVw7MjyjNlMh+ayQlAsKGl mnww== X-Gm-Message-State: AOAM532PRse0YUbDbi5i2V69N6gD+Z4r6F7XvCwo3PyJ6Ex60lSeXYAe 115anx/fZkDEu9P+u13TpfgsXw== X-Google-Smtp-Source: ABdhPJydCZ/jXrds01g38SygDtPX4ovyhhGVLoresFGxG+Fvj8jeLjcgon9C79eWnN9h7K1cLegzTg== X-Received: by 2002:a17:902:760b:b029:d1:9be4:856b with SMTP id k11-20020a170902760bb02900d19be4856bmr2313328pll.1.1599830962073; Fri, 11 Sep 2020 06:29:22 -0700 (PDT) Received: from localhost.localdomain ([117.210.209.48]) by smtp.gmail.com with ESMTPSA id e10sm557988pgb.45.2020.09.11.06.29.15 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 Sep 2020 06:29:21 -0700 (PDT) From: Sumit Garg To: maz@kernel.org, catalin.marinas@arm.com, will@kernel.org Subject: [PATCH v4 2/5] irqchip/gic-v3: Enable support for SGIs to act as NMIs Date: Fri, 11 Sep 2020 18:58:41 +0530 Message-Id: <1599830924-13990-3-git-send-email-sumit.garg@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1599830924-13990-1-git-send-email-sumit.garg@linaro.org> References: <1599830924-13990-1-git-send-email-sumit.garg@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200911_092924_914463_C606E971 X-CRM114-Status: GOOD ( 14.96 ) 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:443 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 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, dianders@chromium.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, jason.wessel@windriver.com, tglx@linutronix.de, 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 7170645..dfd8e03 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -476,6 +476,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); @@ -513,6 +518,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); @@ -1666,6 +1676,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(); @@ -1677,8 +1688,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: