From patchwork Wed Nov 4 08:05:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuichi Ito X-Patchwork-Id: 11879801 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5A5C1C388F7 for ; Wed, 4 Nov 2020 08:12:11 +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 DEEEF22384 for ; Wed, 4 Nov 2020 08:12:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="alNncDm6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DEEEF22384 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=fujitsu.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.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:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version: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=RXr78JNHxiuDD9YN9edVKSEYWq0y0Wjrw4HgAwDeKzw=; b=alNncDm6UDEYz7I/oLl1BPTV9 kcxgLN0pYMMmSmOqSpFOByyJcvB/wmbF/0Z4QeimH21O3GYS+9ToSGS9e4sDC+desHyW/J9poX08N Ar9BSOk1vwrs/lkkVWlkuJK5GgGckxKfSCZ8gcurjVtRZldYSHe6nG22mECOO6CYNdmnFuiXAQJNH XhmlK6K6BFQdgWvmov76Kt3gSOunIp0tQekmRJFDwLcjRi7EGhlqSWpphEdC4FWqxdeJOyrfUiJI5 q3QV3vlLNvbfUfpWfYn/JXPlBWjaqdwcwr6jpVieu2UzRF3psKYo8diAFFBdwfKYs7nCU0yLl72wM LNf9JTgKA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kaDsb-000596-EQ; Wed, 04 Nov 2020 08:10:53 +0000 Received: from esa4.hc1455-7.c3s2.iphmx.com ([68.232.139.117]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kaDsT-00056d-8T for linux-arm-kernel@lists.infradead.org; Wed, 04 Nov 2020 08:10:46 +0000 IronPort-SDR: QNrRE8F8acdjgqSra5nsXbPgnTMph0xwT6asf6GisZUNaKKhsRrQ40z4MxlYbzXGaffaKvOGRe OUrXrNtbXEC3NMHoQkdr65pX0G3F1KooFPFyLIkbZDV5Ojuz6G4MQvtltUZcNBd4C/LqsK+bAp cnMtDRwuMEZjofRjRd9jPd9opG1EloihoqduUk+4/puaqBvSv0kYuY5XGcdkiCRFMZQW0/Xm6t nPChzVbbxmobZmeRaKwTJitJZoBXRh4uL1jWLEIypBMHvr2SI0IADSqEYJpvR/SffKUtjZ1r4s Eu0= X-IronPort-AV: E=McAfee;i="6000,8403,9794"; a="2271279" X-IronPort-AV: E=Sophos;i="5.77,450,1596466800"; d="scan'208";a="2271279" Received: from unknown (HELO yto-r3.gw.nic.fujitsu.com) ([218.44.52.219]) by esa4.hc1455-7.c3s2.iphmx.com with ESMTP; 04 Nov 2020 17:10:43 +0900 Received: from yt-mxq.gw.nic.fujitsu.com (unknown [192.168.83.47]) by yto-r3.gw.nic.fujitsu.com (Postfix) with ESMTP id AE3AC1F507C for ; Wed, 4 Nov 2020 17:10:42 +0900 (JST) Received: from pumpkin.openstacklocal (pumpkin.fct.css.fujitsu.com [10.130.70.189]) by yt-mxq.gw.nic.fujitsu.com (Postfix) with ESMTP id A2A33AC00A7 for ; Wed, 4 Nov 2020 17:10:41 +0900 (JST) Received: by pumpkin.openstacklocal (Postfix, from userid 1016) id 46F05B9A9; Wed, 4 Nov 2020 17:08:03 +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 Subject: [PATCH v2 3/3] arm64: smp: Disable priority masking when NMI is enable on PSR.I section Date: Wed, 4 Nov 2020 17:05:39 +0900 Message-Id: <20201104080539.3205889-4-ito-yuichi@fujitsu.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201104080539.3205889-1-ito-yuichi@fujitsu.com> References: <20201104080539.3205889-1-ito-yuichi@fujitsu.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201104_031045_729775_311D7888 X-CRM114-Status: GOOD ( 11.70 ) 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: Yuichi Ito , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org It should be prohibitted to use priority masking in NMI context. Using local_irq_disable() under the above conditions causes a WARNING. Then, there will be also a mismatch between the PSR.I values and PMR GIC_PRIO_PSR_I_SET. Signed-off-by: Yuichi Ito --- arch/arm64/kernel/smp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index fd59bc7..3c49f06 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -872,7 +872,9 @@ static void ipi_cpu_crash_stop(unsigned int cpu, struct pt_regs *regs) atomic_dec(&waiting_for_crash_ipi); - local_irq_disable(); + if(!in_nmi()) + local_irq_disable(); + sdei_mask_local_cpu(); if (IS_ENABLED(CONFIG_HOTPLUG_CPU))