From patchwork Thu Apr 19 02:19:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Goel, Sameer" X-Patchwork-Id: 10349079 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id F0CE86053F for ; Thu, 19 Apr 2018 02:20:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DF14528573 for ; Thu, 19 Apr 2018 02:20:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CEE0B28988; Thu, 19 Apr 2018 02:20:28 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI 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 28B2928573 for ; Thu, 19 Apr 2018 02:20:08 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=csZT9C4dPsSaaUTTWJlcvQ/Fi9w0JkRfAc2kXl1guKA=; b=ITZ5ngLg2Ow9Z+ Ijb7meum5cTzhLT1d5yUC+HfeOUgQJ4PvdQhYuN/PBBj9isljrm108Mo+U1KyMVscX62TK+HY3Isx +NjnARI6wB84NgsrIl/tqBn432eoFKlHtsslkCZw0MyWvWQJxF+25rTz2a/KLihsaoqmlH/nsD24v s7SJAONmsENWftQgFU4XyLT+bks4BSHB43TFYHpD742QmDtZRd5l7gpAMrCmwQL6rxvZU0SX25Vjy mQ+QbgGO+7lpGYmnlBYLhj1mxO2c6c1qzsoBpEotU7uvS0vrKQYrhCLxnOFUaqbiDrfiSmBI36qH5 ZMuzu5+52xnJ3BovxH9A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1f8zAz-0001yL-6C; Thu, 19 Apr 2018 02:19:57 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1f8zAu-0001pT-U6 for linux-arm-kernel@lists.infradead.org; Thu, 19 Apr 2018 02:19:54 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 888E36081C; Thu, 19 Apr 2018 02:19:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1524104380; bh=5sRj8CcR3N1iT4iNPCt1XeNfK7Pfl2o9mIQHGWbc5PA=; h=From:To:Cc:Subject:Date:From; b=jhSAqmcTt8YcAcYpmicgjCw38etOPNppH1KlsvEy5rcpWHy4977d+/1TwKXEDowD5 /1TaQI+qcDw+NyfQvh1Ey6XBAFzfsKUge5u/OKLHbqIXU4q7tg64f8zQ0ZBxYLH3Ij lXOlyrSp4PRVK3TIXSmEe40a4or6Bjr8+jRSa+vQ= Received: from sgoel1-lnx.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sgoel@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 3F9D760310; Thu, 19 Apr 2018 02:19:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1524104379; bh=5sRj8CcR3N1iT4iNPCt1XeNfK7Pfl2o9mIQHGWbc5PA=; h=From:To:Cc:Subject:Date:From; b=j6M4tvj7O3kbuiYhCnplheZ9HHXoI1YyJfTr2mo40+bjWq68Bupa3hLUjpYM4tpyr 1BFJH+KXpzVEU7mDD7K1eN2LYGAlGUJmCOXQT7GkiIe92OTu5gdORl2+zs3zrOzLOo PjgucubHSZYgoPFInaAcqaG1tpAfTfpl7/5KgP8o= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 3F9D760310 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=sgoel@codeaurora.org From: Sameer Goel To: linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, will.deacon@arm.com, takahiro.akashi@linaro.org Subject: [PATCH] arm64: kexec: Add machine_kexec_mask_interrupts to kexec path Date: Wed, 18 Apr 2018 20:19:36 -0600 Message-Id: <1524104376-21902-1-git-send-email-sgoel@codeaurora.org> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180418_191953_043695_607448F1 X-CRM114-Status: GOOD ( 13.08 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sameer Goel , vikrams@codeaurora.org, shankerd@codeaurora.org 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 In kdump code path SPIs at GIC level are explicitly cleared by calling machine_kexec_mask_interrupts. In case of kexec this functionality is delegated for most part to the device shutdown functions. Add machine_kexec_mask_interrupts to machine_shutdown path to ensure that the irqs are masked at the gic level. Signed-off-by: Sameer Goel --- Porting code for masking irqs at gic from kdump shutdown to kexec path. There was discussion about this functionality in [1]. [1] https://patchwork.kernel.org/patch/9817499/ arch/arm64/include/asm/kexec.h | 6 ++++++ arch/arm64/kernel/machine_kexec.c | 2 +- arch/arm64/kernel/process.c | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/kexec.h b/arch/arm64/include/asm/kexec.h index e17f052..f9ddb41 100644 --- a/arch/arm64/include/asm/kexec.h +++ b/arch/arm64/include/asm/kexec.h @@ -93,6 +93,12 @@ static inline void crash_prepare_suspend(void) {} static inline void crash_post_resume(void) {} #endif +#if defined(CONFIG_KEXEC) +extern void machine_kexec_mask_interrupts(void); +#else +static inline void machine_kexec_mask_interrupts(void) {} +#endif + #endif /* __ASSEMBLY__ */ #endif diff --git a/arch/arm64/kernel/machine_kexec.c b/arch/arm64/kernel/machine_kexec.c index f76ea92..b453180 100644 --- a/arch/arm64/kernel/machine_kexec.c +++ b/arch/arm64/kernel/machine_kexec.c @@ -213,7 +213,7 @@ void machine_kexec(struct kimage *kimage) BUG(); /* Should never get here. */ } -static void machine_kexec_mask_interrupts(void) +void machine_kexec_mask_interrupts(void) { unsigned int i; struct irq_desc *desc; diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c index f08a2ed..9d0337e 100644 --- a/arch/arm64/kernel/process.c +++ b/arch/arm64/kernel/process.c @@ -58,6 +58,7 @@ #include #include #include +#include #ifdef CONFIG_CC_STACKPROTECTOR #include @@ -107,6 +108,7 @@ void arch_cpu_idle_dead(void) void machine_shutdown(void) { disable_nonboot_cpus(); + machine_kexec_mask_interrupts(); } /*