From: Borislav Petkov <bp@alien8.de>
To: Corey Minyard <minyard@acm.org>, "Luck, Tony" <tony.luck@intel.com>
Cc: Andy Lutomirski <luto@kernel.org>,
linux-edac@vger.kernel.org, Corey Minyard <cminyard@mvista.com>,
hidehiro.kawai.ez@hitachi.com, linfeilong@huawei.com,
liuzhiqiang26@huawei.com
Subject: Re: [PATCH v2] x86: Fix MCE error handing when kdump is enabled
Date: Thu, 1 Oct 2020 13:33:18 +0200 [thread overview]
Message-ID: <20201001113318.GC17683@zn.tnic> (raw)
In-Reply-To: <20200930184906.GZ3674@minyard.net>
On Wed, Sep 30, 2020 at 01:49:06PM -0500, Corey Minyard wrote:
> That is the original post for this, yes.
>
> Wu, what kernel version are you using? Can you try to reproduce on the
> current mainstream kernel? I just assumed it was current.
>
> The description isn't that great, no. I'll try again.
>
> The problem is that while waiting in wait_for_panic() in the mce code,
> interrupts are enabled. In the kdump case, there is nothing that will
> wake them up, so they will sit there in the loop until they time out.
>
> In the mean time, the cpu handling the panic calls some IPMI code that
> stores panic information in the IPMI event log. Since interrupts are
> enabled on the CPUs in wait_for_panic(), those CPUs are handling
> interrupts from the IPMI hardware. They will not, however, handle
> the NMI IPI that gets sent from the panic() code for kdump.
>
> The IPMI code has disabled locks to avoid a deadlock if the exception
> happens while in IPMI code. So the panic-handling part of IPMI and the
> IPMI interrupt handling are both running at the same time, messing each
> other up.
>
> It seems, in general, like a bad idea to have interrupts enabled on some
> CPUs while running through the panic() code and after the new kdump
> kernel has started. There are other issues that might come from this.
>
> I'm also not quite sure how kdump register information for the CPUs
> in wait_for_panic() gets put into the kernel coredump if you don't do
> something like my patch.
>
Ok, thanks for taking the time, this makes a lot more sense to me.
Now, from looking at the code, I'm thinking that we should simply "let
go" the other CPUs just like we do in mce_check_crashing_cpu(), if
kdump is starting. Instead of spinning with IRQs enabled.
Simply run mce_check_crashing_cpu() at wait_for_panic() entry, just like
exc_machine_check_kernel() does now. The logic being, if we're going
to wait for panic but we're starting the kdump kernel anyway, then we
better let the CPUs go so that they can do all kinds of IRQ servicing
etc and don't interfere.
*If* we don't kdump, we timeout the usual way.
Tony, how does that logic sound?
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
next prev parent reply other threads:[~2020-10-01 11:33 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-29 21:16 [PATCH v2] x86: Fix MCE error handing when kdump is enabled minyard
2020-09-30 17:56 ` Borislav Petkov
2020-09-30 18:49 ` Corey Minyard
2020-10-01 11:33 ` Borislav Petkov [this message]
2020-10-01 13:44 ` Corey Minyard
2020-10-01 16:16 ` Borislav Petkov
2020-10-01 16:29 ` Luck, Tony
2020-10-01 16:58 ` Borislav Petkov
2020-10-01 17:12 ` Corey Minyard
2020-10-10 1:36 ` Zhiqiang Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201001113318.GC17683@zn.tnic \
--to=bp@alien8.de \
--cc=cminyard@mvista.com \
--cc=hidehiro.kawai.ez@hitachi.com \
--cc=linfeilong@huawei.com \
--cc=linux-edac@vger.kernel.org \
--cc=liuzhiqiang26@huawei.com \
--cc=luto@kernel.org \
--cc=minyard@acm.org \
--cc=tony.luck@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.