Re: [PATCH -v2 7/7] x86, NMI, Remove do_nmi_callback logic

Don Zickus
2010-09-27T15:16:30Z

On Mon, Sep 27, 2010 at 03:43:41PM +0200, Robert Richter wrote:
> On 27.09.10 08:56:44, huang ying wrote:
>
> > >> -static int unknown_nmi_panic_callback(struct pt_regs *regs, int cpu)
> > >> -{
> > >> -     unsigned char reason = get_nmi_reason();
> > >> -     char buf[64];
> > >> -
> > >> -     sprintf(buf, "NMI received for unknown reason %02x\n", reason);
> > >> -     die_nmi(buf, regs, 1); /* Always panic here */
> > >> -     return 0;
> > >
> > > You are dropping this code that is different to panic().
> >
> > What is the difference? Is it relevant?
>
> I think yes, since the code behaves different. Otherwise we could
> remove die_nmi() completly and replace it by panic(). But both are
> different implementions. Maybe we can merge the code, but I didn't
> look at it closly.

Actually die_nmi is a wrapper around panic with two important pieces.
One, it dumps some registers and two it does another notifier call to
DIE_NMIWATCHDOG (which correlates to another discussion in this patch
series).

So if we do any consolidation between panic and die_nmi, it should be
convert to die_nmi. But then I wonder if that breaks the original
semantics of 'panic_on_unrecovered_nmi'. I don't think so though.

Cheers,
Don