linux-mips
[Top] [All Lists]

Re: [PATCH] MIPS: Print correct PC in trace dump after NMI exception

To: thomas.langer@lantiq.com
Subject: Re: [PATCH] MIPS: Print correct PC in trace dump after NMI exception
From: Ralf Baechle <ralf@linux-mips.org>
Date: Tue, 8 Oct 2013 14:29:05 +0200
Cc: markos.chandras@imgtec.com, linux-mips@linux-mips.org, Leonid.Yegoshin@imgtec.com
In-reply-to: <593AEF6C47F46446852B067021A273D6D990182F@MUCSE039.lantiq.com>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1381232371-25017-1-git-send-email-markos.chandras@imgtec.com> <593AEF6C47F46446852B067021A273D6D990182F@MUCSE039.lantiq.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.21 (2010-09-15)
On Tue, Oct 08, 2013 at 11:48:54AM +0000, thomas.langer@lantiq.com wrote:

> >  void __noreturn nmi_exception_handler(struct pt_regs *regs)
> >  {
> > +   char str[100];
> > +
> >     raw_notifier_call_chain(&nmi_chain, 0, regs);
> >     bust_spinlocks(1);
> > -   printk("NMI taken!!!!\n");
> > -   die("NMI", regs);
> > +   snprintf(str, 100, "CPU%d NMI taken, CP0_EPC=%lx\n",
> > +            smp_processor_id(), regs->cp0_epc);
> > +   regs->cp0_epc = read_c0_errorepc();
> 
> If this is a YAMON specific fix, why is it done in a common file?

The installation of an NMI handler is platform specific - this handler
however in all its simplicity is generic - or at least trying to.

The NMI on MIPS is notoriously hard to use.  The vectors is pointing to
the boot ROM so firmware first gets its grubby hands on a fresh NMI and
on most systems it'll do the firmware equivalent of a panic or reset
the system outright.  If that's still working - it's about the worst
tested functionality of firmware ...

  Ralf

<Prev in Thread] Current Thread [Next in Thread>