From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753285AbcGLJKf (ORCPT ); Tue, 12 Jul 2016 05:10:35 -0400 Received: from cn.fujitsu.com ([59.151.112.132]:37614 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1750838AbcGLJKe (ORCPT ); Tue, 12 Jul 2016 05:10:34 -0400 X-IronPort-AV: E=Sophos;i="5.22,518,1449504000"; d="scan'208";a="8624139" From: "Wei, Jiangang" To: "bhe@redhat.com" CC: "kexec@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "xlpang@redhat.com" , "tglx@linutronix.de" , "fenghua.yu@intel.com" , "ebiederm@xmission.com" , "x86@kernel.org" , "hpa@zytor.com" , "mingo@redhat.com" Subject: Re: [PATCH v2] kexec: Fix kdump failure with notsc Thread-Topic: [PATCH v2] kexec: Fix kdump failure with notsc Thread-Index: AQHR2DkmJRcl93aqHkuGcdrihkYm5qAT3VqAgAAY9wCAAAz5AA== Date: Tue, 12 Jul 2016 09:10:29 +0000 Message-ID: <1468314496.15074.67.camel@localhost> References: <1467886646-2638-1-git-send-email-weijg.fnst@cn.fujitsu.com> <578493AD.3000403@redhat.com> <20160712082150.GC3524@x1.redhat.com> In-Reply-To: <20160712082150.GC3524@x1.redhat.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.167.226.50] Content-Type: text/plain; charset="utf-8" Content-ID: MIME-Version: 1.0 X-yoursite-MailScanner-ID: BDF1D498F58D.AD300 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: weijg.fnst@cn.fujitsu.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id u6C9Af0v026279 On Tue, 2016-07-12 at 16:21 +0800, Baoquan He wrote: > On 07/12/16 at 02:52pm, Xunlei Pang wrote: > > On 2016/07/07 at 18:17, Wei Jiangang wrote: > > > Signed-off-by: Wei Jiangang > > > --- > > > +/* Local APIC is disabled by the kernel for crash or reboot path */ > > > +static int disabled_local_apic; > > > + > > > /* > > > * Knob to control our willingness to enable the local APIC. > > > * > > > @@ -1097,10 +1100,16 @@ void lapic_shutdown(void) > > > #endif > > > disable_local_APIC(); > > > > > > + disabled_local_apic = 1; > > > > > > local_irq_restore(flags); > > > } > > > > > > +int lapic_disabled(void) > > > +{ > > > + return disabled_local_apic; > > > +} > > > + > > > /** > > > * sync_Arb_IDs - synchronize APIC bus arbitration IDs > > > */ > > > diff --git a/arch/x86/kernel/machine_kexec_32.c b/arch/x86/kernel/machine_kexec_32.c > > > index 469b23d6acc2..c934a7868e6b 100644 > > > --- a/arch/x86/kernel/machine_kexec_32.c > > > +++ b/arch/x86/kernel/machine_kexec_32.c > > > @@ -202,14 +202,13 @@ void machine_kexec(struct kimage *image) > > > local_irq_disable(); > > > hw_breakpoint_disable(); > > > > > > - if (image->preserve_context) { > > > + if (image->preserve_context || lapic_disabled()) { > > > #ifdef CONFIG_X86_IO_APIC > > > /* > > > * We need to put APICs in legacy mode so that we can > > > * get timer interrupts in second kernel. kexec/kdump > > > * paths already have calls to disable_IO_APIC() in > > > - * one form or other. kexec jump path also need > > > - * one. > > > + * one form or other. kexec jump path also need one. > > > */ > > > disable_IO_APIC(); > > > > Hi Wei, > > > > As the comment says, kexec/kdump paths already have disable_IO_APIC(), why again here? > > I also have this question. I guess Jiangang didn't post his modification > correctly. He should remove calling of disable_IO_APIC in > native_machine_crash_shutdown(). Assume his test was done on correct > code change. Hi he, Thanks for your suggestion firstly. In fact, Eric had suggested me to do that last week (https://lkml.org/lkml/2016/7/8/14). And i had a try to remove the calling of disable_IO_APIC in native_machine_crash_shutdown(). But it doesn't work for kdump with notsc. Thanks, wei > > > > > Regards, > > Xunlei > > > > > #endif > > > diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c > > > index 5a294e48b185..d3598cdd6437 100644 > > > --- a/arch/x86/kernel/machine_kexec_64.c > > > +++ b/arch/x86/kernel/machine_kexec_64.c > > > @@ -23,6 +23,7 @@ > > > #include > > > #include > > > #include > > > +#include > > > #include > > > #include > > > #include > > > @@ -269,14 +270,13 @@ void machine_kexec(struct kimage *image) > > > local_irq_disable(); > > > hw_breakpoint_disable(); > > > > > > - if (image->preserve_context) { > > > + if (image->preserve_context || lapic_disabled()) { > > > #ifdef CONFIG_X86_IO_APIC > > > /* > > > * We need to put APICs in legacy mode so that we can > > > * get timer interrupts in second kernel. kexec/kdump > > > * paths already have calls to disable_IO_APIC() in > > > - * one form or other. kexec jump path also need > > > - * one. > > > + * one form or other. kexec jump path also need one. > > > */ > > > disable_IO_APIC(); > > > #endif > > > > > > _______________________________________________ > > kexec mailing list > > kexec@lists.infradead.org > > http://lists.infradead.org/mailman/listinfo/kexec > >