From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753487AbbCBCct (ORCPT ); Sun, 1 Mar 2015 21:32:49 -0500 Received: from TYO202.gate.nec.co.jp ([210.143.35.52]:46148 "EHLO tyo202.gate.nec.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751781AbbCBCcq convert rfc822-to-8bit (ORCPT ); Sun, 1 Mar 2015 21:32:46 -0500 From: Naoya Horiguchi To: Prarit Bhargava CC: Naoya Horiguchi , Tony Luck , Borislav Petkov , Vivek Goyal , "linux-kernel@vger.kernel.org" , Junichi Nomura , Kiyoshi Ueda Subject: Re: [PATCH v2 1/2] x86: mce: kexec: turn off MCE in kexec Thread-Topic: [PATCH v2 1/2] x86: mce: kexec: turn off MCE in kexec Thread-Index: AQHQUkoNpYXYiYQheEug6LuKQ8Lb850DwF0AgAAa7wCAAAf3gIAD/ymA Date: Mon, 2 Mar 2015 02:16:49 +0000 Message-ID: <20150302021649.GA25064@hori1.linux.bs1.fc.nec.co.jp> References: <1425013116-23581-1-git-send-email-n-horiguchi@ah.jp.nec.com> <54F05080.9090605@redhat.com> <54F06718.3020401@gmail.com> <54F06DC7.9060900@redhat.com> In-Reply-To: <54F06DC7.9060900@redhat.com> Accept-Language: ja-JP, en-US Content-Language: ja-JP X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.128.101.9] Content-Type: text/plain; charset="iso-2022-jp" Content-ID: <3B22FA1955D5D34B8DFBA7C43E0A8E81@gisp.nec.co.jp> Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 27, 2015 at 08:14:47AM -0500, Prarit Bhargava wrote: > On 02/27/2015 07:46 AM, Naoya Horiguchi wrote: > > Hi Prarit, > > > > On Fri, Feb 27, 2015 at 06:09:52AM -0500, Prarit Bhargava wrote: > > ... > >> > @@ -157,6 +160,11 @@ void native_machine_crash_shutdown(struct pt_regs *regs) > >> > /* The kernel is broken so disable interrupts */ > >> > local_irq_disable(); > >> > > >> > + /* > >> > + * We can't expect MCE handling to work any more, so turn it off. > >> > + */ > >> > + cpu_emergency_mce_disable(); > >> > >> What if the system is actually having problems with MCE errors -- which are > >> leading to system panics of some sort. Do you *really* want the system to > >> continue on at that point? > > > > Yes, when running the above code, the system doesn't run any business logic, > > so no worry about consuming broken data caused by HW errors. > > And what we really want to get is any kind of information to find out what > > caused the 1st panic, which are likely to be contained in kdump data. > > So I think it's justified to improve the success rate of kdump by continuing > > the operation here. > > I looked into it a bit further -- IIUC (according to the Intel spec) disabling > MCE this way will result in power cycle of the system if an MCE is detected. So > I guess it isn't a worry for Intel. If anyone from AMD can hazard a guess what > happens in their case it would be appreciated. > > I still don't like this approach all that much as a corrected non-fatal error is > something I would want to know about as an admin, but that risk is mitigated by > BMC and system monitoring hardware. Generally corrected non-fatal errors are not reported via MCE but via CMCI, so not affected by sync timeout problem (they should be logged by mcelog after reboot in a normal manner.) But as for BMC/FW/HW logging, I'm not 100% sure that such logging mechanisms still work when disabling CR4.MCE, so I might need reconsider this approach. > >But the MCE handler is still enabled after that, so > >if MCE happens and broadcasts around CPUs after the main thread starts the > >2nd kernel (which might not start MCE yet, or might decide not to start MCE,) > >MCE handler runs only on the other CPUs (not on the main thread,) leading to > >kernel panic with MCE synchronization. > > Not having looked at the code (and relying on your description) -- there is no > way to disable the MCE handler? We have the way, as Tony suggesting in another email. And I feel like moving back to that approach in the next version. Thanks, Naoya Horiguchi