From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752275AbdHDLmT (ORCPT ); Fri, 4 Aug 2017 07:42:19 -0400 Received: from mail-pg0-f51.google.com ([74.125.83.51]:36952 "EHLO mail-pg0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751478AbdHDLmS (ORCPT ); Fri, 4 Aug 2017 07:42:18 -0400 Date: Fri, 4 Aug 2017 20:43:01 +0900 From: AKASHI Takahiro To: James Morse Cc: Hoeun Ryu , Catalin Marinas , Will Deacon , Ard Biesheuvel , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] arm64:kexec: have own crash_smp_send_stop() for crash dump for nonpanic cores Message-ID: <20170804114300.GA22805@linaro.org> Mail-Followup-To: AKASHI Takahiro , James Morse , Hoeun Ryu , Catalin Marinas , Will Deacon , Ard Biesheuvel , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <1501830173-15989-1-git-send-email-hoeun.ryu@gmail.com> <59844E98.3020507@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <59844E98.3020507@arm.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 04, 2017 at 11:38:16AM +0100, James Morse wrote: > Hi Hoeun, > > On 04/08/17 08:02, Hoeun Ryu wrote: > > Commit 0ee5941 : (x86/panic: replace smp_send_stop() with kdump friendly > > version in panic path) introduced crash_smp_send_stop() which is a weak > > function and can be overriden by architecture codes to fix the side effect > > caused by commit f06e515 : (kernel/panic.c: add "crash_kexec_post_ > > notifiers" option). > > If I've understood correctly: if we boot with this option core code doesn't use > our machine_crash_shutdown(), and instead calls crash_smp_send_stop(), which we No. Machine_crash_shutdown() is always called, but at that time, all the cpus other than the crashing cpu have already died in this case. > don't have, so it uses the default smp_send_stop(), which doesn't save the regs. > > Thanks for catching this! > > > Could we rename smp_send_crash_stop() crash_smp_send_stop() and add the > called-twice logic there? They are similar enough that I'm getting them muddled > already! > Nice. -Takahiro AKASHI > > Thanks, > > James > > > > ARM64 architecture uses the weak version function and the problem is that > > the weak function simply calls smp_send_stop() which makes other CPUs > > offline and takes away the chance to save crash information for nonpanic > > CPUs in machine_crash_shutdown() when crash_kexec_post_notifiers kernel > > option is enabled. > > > > Calling smp_send_crash_stop() in the function is useless because all > > nonpanic CPUs are already offline by smp_send_stop() in this case and > > smp_send_crash_stop() only works against online CPUs. > > > > The result is that /proc/vmcore is not available with the error messages; > > "Warning: Zero PT_NOTE entries found", "Kdump: vmcore not initialized". > > > > crash_smp_send_stop() is implemented for ARM64 architecture to fix this > > problem and the function (strong symbol version) saves crash information > > for nonpanic CPUs using smp_send_crash_stop() and machine_crash_shutdown() > > tries to save crash information for nonpanic CPUs only when > > crash_kexec_post_notifiers kernel option is disabled. > >