From patchwork Thu Jan 12 04:21:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 91037 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1445718qgi; Wed, 11 Jan 2017 20:21:14 -0800 (PST) X-Received: by 10.84.137.169 with SMTP id 38mr18563155pln.128.1484194874367; Wed, 11 Jan 2017 20:21:14 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id r2si7886985pli.327.2017.01.11.20.21.14 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Jan 2017 20:21:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cRWsz-0001eS-Cf; Thu, 12 Jan 2017 04:21:13 +0000 Received: from mail-pf0-x230.google.com ([2607:f8b0:400e:c00::230]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cRWsv-0001No-G1 for linux-arm-kernel@lists.infradead.org; Thu, 12 Jan 2017 04:21:11 +0000 Received: by mail-pf0-x230.google.com with SMTP id 189so5643476pfu.3 for ; Wed, 11 Jan 2017 20:20:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=yWbwkYd1P5a0ispN9w1CFcUIU16hfSr0fdQDZdruf2Q=; b=eaZNHshZTXVHwvGYwf3LwkMjkvyBNEfX9R6jmK5r1yoN9ya36Foj4Kj8W2v6bs7ABr RXTSYWwAAJRclecjsZ4jwfnFt4FTs8vTEQCbn5Fr576EZ9sqF+k9GR/i+dq25ctSOiPz gLvTQfoA6Uq1rdNCn/X5GBPtClbkOQVYUb8/I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=yWbwkYd1P5a0ispN9w1CFcUIU16hfSr0fdQDZdruf2Q=; b=Z6TM5r3b0hfBW5b5+UYhydoKl/pOfoG4ubB7g4J2P7H2xrGzLuqFZoee1PTQkvqdQC mdFiu5DdQJ9Ayh3btWtITSlYuBG1r+xk4GxAc8EvMEatq/afDGPk/Xnxw3fwA2EzHVl8 zO2A6pkKCBFd1tXwp+NQg/VY6qHY+Eip60TGDru4ic6ONvquV8q+qMvoXTtCOq7cHi8n 34vzgBmNC0/oDVlPwqxqN0md06dt0OYx4nKah6+gpvwAkcow2ffUhyD9g1gJ+hGXOluZ 3b5mOFRR72dTKHW4Fvw2MR9pDNv2IkqcKDYm4Iz9hBWeAqqtajFFV6Epgw/OhZl9h/1n wihQ== X-Gm-Message-State: AIkVDXL9E1YkStRcbc145x8K3CbqBOPJBpPyQOeN6E+YKNPE5kmtgPgiHHutrEFBselJMRsO X-Received: by 10.84.164.231 with SMTP id l36mr18564131plg.33.1484194847943; Wed, 11 Jan 2017 20:20:47 -0800 (PST) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id 18sm17208067pgf.28.2017.01.11.20.20.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Jan 2017 20:20:46 -0800 (PST) Date: Thu, 12 Jan 2017 13:21:44 +0900 From: AKASHI Takahiro To: Will Deacon Subject: Re: [PATCH v29 4/9] arm64: kdump: implement machine_crash_shutdown() Message-ID: <20170112042143.GF20972@linaro.org> Mail-Followup-To: AKASHI Takahiro , Will Deacon , catalin.marinas@arm.com, james.morse@arm.com, geoff@infradead.org, bauerman@linux.vnet.ibm.com, dyoung@redhat.com, mark.rutland@arm.com, kexec@lists.infradead.org, linux-arm-kernel@lists.infradead.org References: <20161228043347.27358-1-takahiro.akashi@linaro.org> <20161228043605.27470-3-takahiro.akashi@linaro.org> <20170110113248.GC21598@arm.com> <20170111063626.GE20972@linaro.org> <20170111105405.GF12388@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20170111105405.GF12388@arm.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170111_202109_574224_5F80182E X-CRM114-Status: GOOD ( 18.25 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2607:f8b0:400e:c00:0:0:0:230 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: mark.rutland@arm.com, geoff@infradead.org, catalin.marinas@arm.com, kexec@lists.infradead.org, james.morse@arm.com, bauerman@linux.vnet.ibm.com, dyoung@redhat.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org On Wed, Jan 11, 2017 at 10:54:05AM +0000, Will Deacon wrote: > On Wed, Jan 11, 2017 at 03:36:28PM +0900, AKASHI Takahiro wrote: > > On Tue, Jan 10, 2017 at 11:32:48AM +0000, Will Deacon wrote: > > > On Wed, Dec 28, 2016 at 01:36:01PM +0900, AKASHI Takahiro wrote: > > > > @@ -22,6 +25,7 @@ > > > > extern const unsigned char arm64_relocate_new_kernel[]; > > > > extern const unsigned long arm64_relocate_new_kernel_size; > > > > > > > > +static bool in_crash_kexec; > > > > > > Do you actually need this bool? Why not call kexec_crash_loaded() instead? > > > > The two have different meanings: > > "in_crash_kexec" indicates that kdump is taking place, while > > kexec_crash_loaded() tells us only whether crash dump kernel has been > > loaded or not. > > > > It is crucial to distinguish them especially for machine_kexec() > > which can be called on normal kexec even if kdump has been set up. > > Ah, I see. So how about just doing: > > if (kimage == kexec_crash_image) > > in machine_kexec? Yeah, it should work. Do you want to merge the following hunk, or expect that I will re-send the whole patch series (with other changes if any)? -Takahiro AkASHI > Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ===8<== diff --git a/arch/arm64/kernel/machine_kexec.c b/arch/arm64/kernel/machine_kexec.c index 994fe0bc5cc0..c0fc3d458195 100644 --- a/arch/arm64/kernel/machine_kexec.c +++ b/arch/arm64/kernel/machine_kexec.c @@ -26,7 +26,6 @@ extern const unsigned char arm64_relocate_new_kernel[]; extern const unsigned long arm64_relocate_new_kernel_size; -static bool in_crash_kexec; static unsigned long kimage_start; /** @@ -154,7 +153,7 @@ void machine_kexec(struct kimage *kimage) * New cpus may have become stuck_in_kernel after we loaded the image. */ BUG_ON((cpus_are_stuck_in_kernel() || (num_online_cpus() > 1)) && - !WARN_ON(in_crash_kexec)); + !WARN_ON(kimage == kexec_crash_image)); reboot_code_buffer_phys = page_to_phys(kimage->control_code_page); reboot_code_buffer = phys_to_virt(reboot_code_buffer_phys); @@ -206,8 +205,8 @@ void machine_kexec(struct kimage *kimage) * relocation is complete. */ - cpu_soft_restart(!in_crash_kexec, reboot_code_buffer_phys, kimage->head, - kimage_start, 0); + cpu_soft_restart(kimage != kexec_crash_image, + reboot_code_buffer_phys, kimage->head, kimage_start, 0); BUG(); /* Should never get here. */ } @@ -250,8 +249,6 @@ void machine_crash_shutdown(struct pt_regs *regs) { local_irq_disable(); - in_crash_kexec = true; - /* shutdown non-crashing cpus */ smp_send_crash_stop();