From patchwork Tue Jun 11 18:10:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaro Koskinen X-Patchwork-Id: 10988099 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 242AB76 for ; Tue, 11 Jun 2019 18:11:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 109A528355 for ; Tue, 11 Jun 2019 18:11:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 047E52857E; Tue, 11 Jun 2019 18:11:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0FA6E28355 for ; Tue, 11 Jun 2019 18:11:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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:In-Reply-To: References:List-Owner; bh=pEYIr2/XAL3EqIfvoRjXwtZpVt5E2F5q4WAGSFo5ntk=; b=BKj vmDVlUPj4UyQMnvt2S8Y2vF2lyoJ1dnKmDk58MZDTvqzxrN40xYLG1LlphskYro67qudjX6lircCT fQwq6ZRJti/4cNxUQHEwGPP1+uwVsxfwZ8KyM0Vpi5Mz6j+1Dr1ZWl69Zkvig0E0LgF/DQdt0aZ5N a0s+WiGcH8mtu/p7PsYTUKPwnAlljXRxrMfqW0dv6uXXJMUCOIFzQjh2nJW6NIkp0NAAUqrjNAN0+ gnFKbjxIS7QefaQWSDuDl4ONpVgiBqcJKDF6gfY0h/GiR0a4ZNztYcHV3lcZ4grviBYBO6FDOEg1x VzIXuvosmHrcjLYfOiLfcrZH7JB/0Gw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1halEZ-0007Lb-Dm; Tue, 11 Jun 2019 18:10:59 +0000 Received: from emh03.mail.saunalahti.fi ([62.142.5.109]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1halEV-0007HC-0V for linux-arm-kernel@lists.infradead.org; Tue, 11 Jun 2019 18:10:57 +0000 Received: from localhost.localdomain (85-76-70-161-nat.elisa-mobile.fi [85.76.70.161]) by emh03.mail.saunalahti.fi (Postfix) with ESMTP id 990264003B; Tue, 11 Jun 2019 21:10:50 +0300 (EEST) From: Aaro Koskinen To: Catalin Marinas , Will Deacon , James Morse , Jayachandran Chandrasekharan Nair Subject: [PATCH 1/2] arm64: Improve parking of stopped CPUs Date: Tue, 11 Jun 2019 21:10:49 +0300 Message-Id: <20190611181050.9647-1-aaro.koskinen@iki.fi> X-Mailer: git-send-email 2.17.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190611_111055_231356_438B4F76 X-CRM114-Status: UNSURE ( 7.97 ) X-CRM114-Notice: Please train this message. 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: Aaro Koskinen , linux-arm-kernel@lists.infradead.org, Aaro Koskinen MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Jayachandran C The current code puts the stopped cpus in an 'yield' instruction loop. Using a busy loop here is unnecessary, we can use the cpu_park_loop() function here to do a wfi/wfe. Signed-off-by: Jayachandran C Signed-off-by: Aaro Koskinen Acked-by: Will Deacon --- This is a rebased resend of the patch: https://patchwork.kernel.org/patch/9549145/ arch/arm64/kernel/smp.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index bb4b3f07761a..1a1b96a50245 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -854,9 +854,7 @@ static void ipi_cpu_stop(unsigned int cpu) local_daif_mask(); sdei_mask_local_cpu(); - - while (1) - cpu_relax(); + cpu_park_loop(); } #ifdef CONFIG_KEXEC_CORE From patchwork Tue Jun 11 18:10:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaro Koskinen X-Patchwork-Id: 10988103 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 79F9C14C0 for ; Tue, 11 Jun 2019 18:11:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 680A228355 for ; Tue, 11 Jun 2019 18:11:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5C2052867C; Tue, 11 Jun 2019 18:11:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0E65528355 for ; Tue, 11 Jun 2019 18:11:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.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=xouho1x+Zd6G2FNha7TlfcPFFNvznzDA+b6b4yW7jZM=; b=NdEalwoGk+DzyBACToz/FvWdNA hNoMFlpCLECV690l/eNAzUHGc3g6fSAQEsKLAODXZrMY3nvppVJusZMI7XqhX0BosFu71YHY4j/TZ w2Nkq1XLdXVwu+OnefrFpsgI47QcTo79uP8Ek23/nTzahKItJJRG/CzW6IjlDstWDhJAtTcb4lJir Afq4hVAUAihYS5qiW9KwtbO3GpdJyaJYjhLeSS4SxqfRsdQzGpmNLNZgFPIeHrHfihJxm6sDoCVK3 gYh7qlmnKoI3Q1Habfj4kKAFCz35FA7ERrRqUuwUOsSPOk1VIQRPi+V8T1EFQ1/8ow+nGWetvXW2/ sYXL4rvA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1halEp-0007Xd-6x; Tue, 11 Jun 2019 18:11:15 +0000 Received: from emh03.mail.saunalahti.fi ([62.142.5.109]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1halEV-0007HT-PO for linux-arm-kernel@lists.infradead.org; Tue, 11 Jun 2019 18:10:58 +0000 Received: from localhost.localdomain (85-76-70-161-nat.elisa-mobile.fi [85.76.70.161]) by emh03.mail.saunalahti.fi (Postfix) with ESMTP id 1A3EA40051; Tue, 11 Jun 2019 21:10:50 +0300 (EEST) From: Aaro Koskinen To: Catalin Marinas , Will Deacon , James Morse , Jayachandran Chandrasekharan Nair Subject: [PATCH 2/2] arm64: Implement panic_smp_self_stop() Date: Tue, 11 Jun 2019 21:10:50 +0300 Message-Id: <20190611181050.9647-2-aaro.koskinen@iki.fi> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190611181050.9647-1-aaro.koskinen@iki.fi> References: <20190611181050.9647-1-aaro.koskinen@iki.fi> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190611_111056_011011_A525626E X-CRM114-Status: UNSURE ( 6.91 ) X-CRM114-Notice: Please train this message. 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: Aaro Koskinen , linux-arm-kernel@lists.infradead.org, Aaro Koskinen MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Aaro Koskinen Currently arm64 uses the default implementation of panic_smp_self_stop() that is simply a cpu_relax() loop. As a result, when two CPUs panic() simultaneously we get "SMP: failed to stop secondary CPUs" warnings and extra delays before a reset. Provide an implementation of panic_smp_self_stop() that offlines the CPU properly. Signed-off-by: Aaro Koskinen Reviewed-by: James Morse --- arch/arm64/kernel/smp.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index 1a1b96a50245..5e09e5032409 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -857,6 +857,11 @@ static void ipi_cpu_stop(unsigned int cpu) cpu_park_loop(); } +void panic_smp_self_stop(void) +{ + ipi_cpu_stop(smp_processor_id()); +} + #ifdef CONFIG_KEXEC_CORE static atomic_t waiting_for_crash_ipi = ATOMIC_INIT(0); #endif