Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp44990pxk; Wed, 23 Sep 2020 21:58:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwRv7ESDB/G8biVDNxInSt3VOW8u/O3NStq6iO8nD3OqCJgOYiDTPgO9VNPUWDCPqdBG7FM X-Received: by 2002:a17:906:3bca:: with SMTP id v10mr2761256ejf.57.1600923505469; Wed, 23 Sep 2020 21:58:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600923505; cv=none; d=google.com; s=arc-20160816; b=pGdN+XHoTagVfudcd/VfI/WAfQfitgjRrx9LLo2WqU/NEKwCK7T+ea/bGWh1y8haJ9 i3TQCzdSTAQ8mJloM3nwg4HpAC1ewj1zqNiMfrKhEvKVcx55kyN4Aonlo5loNjCygPwr tYhaJdlRmOqzj20FtZ5ci0Yy+DddaV1KA5oLQEAQU0najg44+XXbkJy6W7ZVsvEtOy0P Vb4frFnikvqobsamGujpH5L6PrN0NYcm7EShSdNmmNlGbLxHgY4br+5rWeuHT5EzJt0R VIunrx0119dbTjkGwItJwsQ850ePLgUbEzEU5LuJMgFGphAc4uKCJNqjRIwaT2S+l/9J 9kCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=vV91mb1+AJnYEyRoE2qLdhT21GGDdVNp2wNMWXX6mlg=; b=SC4Y0zTBC666UJfy7ek5gLx5YP/oeJaovd+g9Yy6nRN5Hgw4aHkyeNukE6KOeg/CPD LUopuITlnS96YPKT9QzvQ0psTaam3AKeaOBzARODhG0ACX+v6uA4bAFDIFSBKw7d0uX4 tGJ1f4N1Dl+DUFA++IDGB1URHIIuSSfBWYS4jNVbmFPIrTtMXyHxloxiPXLVHE7OV5Xy WkRQHwnwOt7A3ypo5IuXQlTZ59yVFEc+aynr8m/z6YCAcFIRubCFe80pHcyVxFa6C3um JQxmx1hizTgvuEa2V0ox9847dOTkceiMfTY7fsSruOaeeXJUsBwJmBPuvZZ2xPHHfm5r eD0A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d7si1449233eds.69.2020.09.23.21.57.59; Wed, 23 Sep 2020 21:58:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726773AbgIXEzM (ORCPT + 99 others); Thu, 24 Sep 2020 00:55:12 -0400 Received: from mgwkm01.jp.fujitsu.com ([202.219.69.168]:51380 "EHLO mgwkm01.jp.fujitsu.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726466AbgIXEzL (ORCPT ); Thu, 24 Sep 2020 00:55:11 -0400 X-Greylist: delayed 682 seconds by postgrey-1.27 at vger.kernel.org; Thu, 24 Sep 2020 00:55:11 EDT Received: from kw-mxauth.gw.nic.fujitsu.com (unknown [192.168.231.132]) by mgwkm01.jp.fujitsu.com with smtp id 6f2d_0806_3f5c20b7_63a3_4f28_b816_5bd9df69c61f; Thu, 24 Sep 2020 13:43:44 +0900 Received: from pumpkin.openstacklocal (pumpkin.fct.css.fujitsu.com [10.130.70.189]) by kw-mxauth.gw.nic.fujitsu.com (Postfix) with ESMTP id 01A76AC008D for ; Thu, 24 Sep 2020 13:43:44 +0900 (JST) Received: by pumpkin.openstacklocal (Postfix, from userid 1016) id 5C1B31C014; Thu, 24 Sep 2020 13:42:45 +0900 (JST) From: Yuichi Ito To: maz@kernel.org, sumit.garg@linaro.org, tglx@linutronix.de, jason@lakedaemon.net, catalin.marinas@arm.com, will@kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] irqchip/gic-v3: Enable support for SGIs to act as NMIs Date: Thu, 24 Sep 2020 13:42:35 +0900 Message-Id: <20200924044236.1245808-2-ito-yuichi@fujitsu.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200924044236.1245808-1-ito-yuichi@fujitsu.com> References: <20200924044236.1245808-1-ito-yuichi@fujitsu.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sumit Garg 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 262bc7377abd..2eda18d1df59 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: -- 2.25.1