From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933499AbcIVByL (ORCPT ); Wed, 21 Sep 2016 21:54:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40742 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933452AbcIVByI (ORCPT ); Wed, 21 Sep 2016 21:54:08 -0400 Date: Thu, 22 Sep 2016 09:53:54 +0800 From: "'Dave Young'" To: =?utf-8?B?5rKz5ZCI6Iux5a6PIC8gS0FXQUnvvIxISURFSElSTw==?= Cc: "xlpang@redhat.com" , Andrew Morton , Daniel Walker , "linux-mips@linux-mips.org" , Baoquan He , Toshi Kani , Masami Hiramatsu , "x86@kernel.org" , "kexec@lists.infradead.org" , "linux-kernel@vger.kernel.org" , Ralf Baechle , HATAYAMA Daisuke , Ingo Molnar , "Eric W. Biederman" , "H. Peter Anvin" , "xen-devel@lists.xenproject.org" , Thomas Gleixner , Borislav Petkov , Vivek Goyal , David Vrabel Subject: Re: [V4 PATCH 1/2] x86/panic: Replace smp_send_stop() with kdump friendly version in panic path Message-ID: <20160922015354.GA12860@dhcp-128-65.nay.redhat.com> References: <20160810080946.11028.97686.stgit@sysi4-13.yrl.intra.hitachi.co.jp> <20160810080948.11028.15344.stgit@sysi4-13.yrl.intra.hitachi.co.jp> <20160812031633.GA2983@dhcp-128-65.nay.redhat.com> <04EAB7311EE43145B2D3536183D1A84454CBBABC@GSjpTKYDCembx31.service.hitachi.net> <57E0E7EC.2010704@redhat.com> <04EAB7311EE43145B2D3536183D1A84454D0FECC@GSjpTKYDCembx31.service.hitachi.net> <04EAB7311EE43145B2D3536183D1A84454D101A4@GSjpTKYDCembx31.service.hitachi.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <04EAB7311EE43145B2D3536183D1A84454D101A4@GSjpTKYDCembx31.service.hitachi.net> User-Agent: Mutt/1.7.0 (2016-08-17) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 22 Sep 2016 01:54:07 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, 河合英宏 Thanks for the patch log update, it looks good to me. Acked-by: Dave Young On 09/20/16 at 11:22am, 河合英宏 / KAWAI,HIDEHIRO wrote: > Here is the revised commit description reflecting Dave's > comment. Cc list was copied from -mm version. > > From: Hidehiro Kawai > Subject: x86/panic: replace smp_send_stop() with kdump friendly version in panic path > > This patch fixes a problem reported by Daniel Walker > (https://lkml.org/lkml/2015/6/24/44). > > When kernel panics with crash_kexec_post_notifiers kernel parameter > enabled, other CPUs are stopped by smp_send_stop() instead of > machine_crash_shutdown() in __crash_kexec() path. > > panic() > if crash_kexec_post_notifiers == 1 > smp_send_stop() > atomic_notifier_call_chain() > kmsg_dump() > __crash_kexec() > machine_crash_shutdown() > > Different from smp_send_stop(), machine_crash_shutdown() stops other > CPUs with extra works for kdump. So, if smp_send_stop() stops other > CPUs in advance, these extra works won't be done. For x86, kdump > routines miss to save other CPUs' registers and disable virtualization > extensions. > > To fix this problem, call a new kdump friendly function, > crash_smp_send_stop(), instead of the smp_send_stop() when > crash_kexec_post_notifiers is enabled. crash_smp_send_stop() is a > weak function, and it just call smp_send_stop(). Architecture > codes should override it so that kdump can work appropriately. > This patch only provides x86-specific version. > > For Xen's PV kernel, just keep the current behavior. > As for Dom0, it doesn't use crash_kexec routines, and it relies on > panic notifier chain. At the end of the chain, a hypercall is > issued which requests the hypervisor to execute kdump. This means > regardless of crash_kexec_post_notifiers setting, smp_send_stop(). > For PV HVM, it would work similarly to baremetal kernels with extra > cleanups for hypervisor. It doesn't need additional care. > > Changes in V4: > - Keep to use smp_send_stop if crash_kexec_post_notifiers is not set > - Rename panic_smp_send_stop to crash_smp_send_stop > - Don't change the behavior for Xen's PV kernel > > Changes in V3: > - Revise comments, description, and symbol names > > Changes in V2: > - Replace smp_send_stop() call with crash_kexec version which > saves cpu states and cleans up VMX/SVM > - Drop a fix for Problem 1 at this moment > > Fixes: f06e5153f4ae (kernel/panic.c: add "crash_kexec_post_notifiers" option) > Link: http://lkml.kernel.org/r/20160810080948.11028.15344.stgit@sysi4-13.yrl.intra.hitachi.co.jp > Signed-off-by: Hidehiro Kawai > Reported-by: Daniel Walker > Cc: Dave Young > Cc: Baoquan He > Cc: Vivek Goyal > Cc: Eric Biederman > Cc: Masami Hiramatsu > Cc: Daniel Walker > Cc: Xunlei Pang > Cc: Thomas Gleixner > Cc: Ingo Molnar > Cc: "H. Peter Anvin" > Cc: Borislav Petkov > Cc: David Vrabel > Cc: Toshi Kani > Cc: Ralf Baechle > Cc: David Daney > Cc: Aaro Koskinen > Cc: "Steven J. Hill" > Cc: Corey Minyard > Signed-off-by: Andrew Morton > [snip] Thanks Dave