From: Don Zickus <dzickus@redhat.com>
To: "Andrei E. Warkentin" <andrey.warkentin@gmail.com>
Cc: linux-kernel@vger.kernel.org,
kgdb-bugreport@lists.sourceforge.net, jason.wessel@windriver.com
Subject: Re: [PATCH] x86 NMI: Be smarter about invoking panic() inside NMI handler.
Date: Tue, 27 Mar 2012 12:06:01 -0400 [thread overview]
Message-ID: <20120327160601.GA19273@redhat.com> (raw)
In-Reply-To: <CANz0V+5ayWh3-xR1i4nCqTGF+6x+f7mOeokEhCCXhvG3a3pFhw@mail.gmail.com>
On Tue, Mar 20, 2012 at 01:57:41PM -0400, Andrei E. Warkentin wrote:
> Hi,
>
> 2012/3/1 Andrei Warkentin <andrey.warkentin@gmail.com>:
> > If two (or more) unknown NMIs arrive on different CPUs, there
> > is a large chance both CPUs will wind up inside panic(). This
> > is fine, unless you want to enter KDB - KDB cannot round up
> > all CPUs, because some of them are stuck inside
> > panic_smp_self_stop with NMI latched. This is
> > easy to replicate with QEMU. Boot with -smp 4 and
> > send NMI using the monitor.
> >
> > Solution for this - attempt to enter panic() from NMI
> > handler. If panic() is already active in the system,
> > just exit out of the NMI handler. This lets KDB round
> > up CPUs.
> >
> > Signed-off-by: Andrei Warkentin <andrey.warkentin@gmail.com>
> > ---
>
> Any feedback on this? Who are the right maintainers to bug about this?
Hmm, if try_panic fails, then the cpu continues on executing code. This
might further corrupt an already broken system. So I don't think this
patch will work as is.
Perhaps instead of panic'ing in the NMI context, we use irq_work and panic
in an interrupt context instead. We still get the system to stop (though
it might still execute some interrupts) and it will be out of the NMI
context.
However, you will still run into a similar problem when in the
panic/reboot case we shutdown all the remote cpus and have them sitting in
a similar cpu_relax loop in the NMI context, while the panic'ing cpu
cleans things up.
Cheers,
Don
next prev parent reply other threads:[~2012-03-27 16:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-01 7:54 [PATCH] x86 NMI: Be smarter about invoking panic() inside NMI handler Andrei Warkentin
2012-03-20 17:57 ` Andrei E. Warkentin
2012-03-27 16:06 ` Don Zickus [this message]
2012-03-29 7:19 ` Andrei E. Warkentin
2012-03-29 13:01 ` Don Zickus
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=20120327160601.GA19273@redhat.com \
--to=dzickus@redhat.com \
--cc=andrey.warkentin@gmail.com \
--cc=jason.wessel@windriver.com \
--cc=kgdb-bugreport@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox