public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@amd64.org>
To: Don Zickus <dzickus@redhat.com>
Cc: "Richter, Robert" <robert.richter@amd.com>,
	"x86@kernel.org" <x86@kernel.org>,
	Andi Kleen <andi@firstfloor.org>,
	Peter Zijlstra <peterz@infradead.org>,
	"ying.huang@intel.com" <ying.huang@intel.com>,
	LKML <linux-kernel@vger.kernel.org>,
	"paulmck@linux.vnet.ibm.com" <paulmck@linux.vnet.ibm.com>,
	Jason Wessel <jason.wessel@windriver.com>,
	Andi Kleen <ak@linux.intel.com>, Corey Minyard <minyard@acm.org>,
	Jack Steiner <steiner@sgi.com>, Tony Luck <tony.luck@intel.com>
Subject: Re: [V3][PATCH 3/6] x86, nmi: wire up NMI handlers to new routines
Date: Wed, 7 Sep 2011 11:03:10 +0200	[thread overview]
Message-ID: <20110907090310.GA7725@aftab> (raw)
In-Reply-To: <20110906165253.GP5795@redhat.com>

On Tue, Sep 06, 2011 at 12:52:53PM -0400, Don Zickus wrote:

[..]

> > > diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
> > > index 08363b0..3fc65b6 100644
> > > --- a/arch/x86/kernel/cpu/mcheck/mce.c
> > > +++ b/arch/x86/kernel/cpu/mcheck/mce.c
> > > @@ -908,9 +908,6 @@ void do_machine_check(struct pt_regs *regs, long error_code)
> > >
> > >         percpu_inc(mce_exception_count);
> > >
> > > -       if (notify_die(DIE_NMI, "machine check", regs, error_code,
> > > -                          18, SIGKILL) == NOTIFY_STOP)
> > > -               goto out;
> >
> > Yes, this code is strange. I checked all the nmi handlers but couldn't
> > find one that is direct related to this call. But it could be to
> > handle IPIs even in the case of an mce to let backtrace and reboot
> > work. CC'ing mce guys.
> >
> > I would rather add an nmi_handle() call here.
> 
> I checked to and the code predates 2.6.12, so I have no idea why it was
> there.  One of the reasons I wanted to remove it was to keep all the users
> internal to the nmi.c file.  Also I remove most of the parameters from
> notify_die as they were not being used.  I would hate to add them back in
> because of an mce hack.
> 
> I'm sure after 4-5 years (whenever this was added), we can find a better
> way to do whatever it is doing, no?
> 
> But if I have to support this call, it complicates all the changes I made
> unnecessarily. :-(

This code comes from a combined x86_64 update commit from 2003, AFAICT:

commit 3d71dbc9afbd7eecdc71e0329d6f16f2dcd48e39
Author: Andi Kleen <ak@suse.de>
Date:   Mon Mar 24 19:54:54 2003 -0800

    [PATCH] x86-64 updates

    Lots of x86-64 updates. Merge with 2.4 and NUMA works now. Also reenabled
    the preemptive kernel. And some other bug fixes.
    IOMMU disabled by default now because it has problems.

     - Add more CONFIG options for device driver debugging and iommu
       force/debug.  (don't enable iommu force currently)
     - Some S3/ACPI fixes/cleanups from Pavel.
     ....


and the file was called arch/x86_64/kernel/bluesmoke.c back then.
Unfortunately, nothing in the commit message hints at why it was added.
I guess it was some sort of a notification mechanism to warn the rest of
the kernel that we might die soon because we received an MCE, so that
prior can take some cleanup action before going down.

So I don't think we use it anywhere - originally Robert and I thought
that mce-inject.c relies on it indirectly but it does its own NMI
injection when the MCE needs to be broadcast and injected on all cores
and it also registers its own NMI notifier mce_raise_notify() which
you've already converted.

Tony, anything I'm missing?

-- 
Regards/Gruss,
Boris.

Advanced Micro Devices GmbH
Einsteinring 24, 85609 Dornach
GM: Alberto Bozzo
Reg: Dornach, Landkreis Muenchen
HRB Nr. 43632 WEEE Registernr: 129 19551

  reply	other threads:[~2011-09-07 16:49 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-25 16:45 [V3][PATCH 0/6] x86, nmi: new NMI handling routines Don Zickus
2011-08-25 16:45 ` [V3][PATCH 1/6] x86, nmi: split out nmi from traps.c Don Zickus
2011-08-25 16:45 ` [V3][PATCH 2/6] x86, nmi: create new NMI handler routines Don Zickus
2011-08-26  9:44   ` Peter Zijlstra
2011-08-26 14:21     ` Don Zickus
2011-09-06 10:08   ` Robert Richter
2011-09-06 16:53     ` Don Zickus
2011-08-25 16:45 ` [V3][PATCH 3/6] x86, nmi: wire up NMI handlers to new routines Don Zickus
2011-09-06 16:15   ` Robert Richter
2011-09-06 16:52     ` Don Zickus
2011-09-07  9:03       ` Borislav Petkov [this message]
2011-09-06 17:20   ` Corey Minyard
2011-09-06 17:49     ` Don Zickus
2011-09-06 17:59       ` Corey Minyard
2011-08-25 16:45 ` [V3][PATCH 4/6] x86, nmi: add in logic to handle multiple events and unknown NMIs Don Zickus
2011-09-06 16:18   ` Robert Richter
2011-08-25 16:45 ` [V3][PATCH 5/6] x86, nmi: track NMI usage stats Don Zickus
2011-08-25 16:45 ` [V3][PATCH 6/6] x86, nmi: print out NMI stats in /proc/interrupts Don Zickus
2011-09-06 16:39   ` Robert Richter
2011-09-06 17:40     ` Don Zickus
2011-08-26  9:44 ` [V3][PATCH 0/6] x86, nmi: new NMI handling routines Peter Zijlstra
2011-08-26 14:39   ` Don Zickus
2011-08-26 14:51     ` Peter Zijlstra
2011-09-06 16:43 ` Robert Richter

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=20110907090310.GA7725@aftab \
    --to=bp@amd64.org \
    --cc=ak@linux.intel.com \
    --cc=andi@firstfloor.org \
    --cc=dzickus@redhat.com \
    --cc=jason.wessel@windriver.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=minyard@acm.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=peterz@infradead.org \
    --cc=robert.richter@amd.com \
    --cc=steiner@sgi.com \
    --cc=tony.luck@intel.com \
    --cc=x86@kernel.org \
    --cc=ying.huang@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox