Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 04 Sep 2003 15:34:44 -0400 (EDT)
From:      John Baldwin <jhb@FreeBSD.org>
To:        cjarvis@vci.com
Cc:        "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org>
Subject:   Re: non reliable nmi
Message-ID:  <XFMail.20030904153444.jhb@FreeBSD.org>
In-Reply-To: <T6478a49547c0a87ba83a4@vci-gateway.vci.com>

next in thread | previous in thread | raw e-mail | index | archive | help

On 04-Sep-2003 cjarvis@vci.com wrote:
> In <20030904131244.GU556@straylight.oblivion.bg>, on 09/04/03 
>    at 09:12 AM, Peter Pentchev <roam@ringlet.net> said:
> 
>>I haven't kept quite up to date on my x86 hardware lately (read: in the
>>past five to ten years), but I distinctly remember a time when everyone
>>referred to x86's NMI as a joke: a non-maskable interrupt that anyone
>>could mask using a simple CLI instruction.  Not sure if this is still the
>>case, others would have to say if today's processors still may get so
>>wedged that a NMI request would simply be ignored.
> 
> CLI doesn't stop an NMI, but you can mask off NMI in the CMOS RAM.  On
> standard PC-AT platforms anyway.

The bug is probably in FreeBSD in that we mask the NMI LVT entry in the
local APIC on all the APs and only leave it enabled in the BSP.  Thus,
if your NMI gets sent to one of the APs, it is effectively ignored.  You
can try fixing this in mpapic.c like so:

Index: mpapic.c
===================================================================
RCS file: /usr/cvs/src/sys/i386/i386/mpapic.c,v
retrieving revision 1.64
diff -u -r1.64 mpapic.c
--- mpapic.c    25 Aug 2003 09:48:47 -0000      1.64
+++ mpapic.c    4 Sep 2003 18:40:47 -0000
@@ -74,7 +74,9 @@
        /* setup LVT2 as NMI, masked till later... */
        temp = lapic.lvt_lint1;
        temp &= ~(APIC_LVT_M | APIC_LVT_TM | APIC_LVT_IIPP | APIC_LVT_DM);
-       temp |= 0x00010400;             /* masked, edge trigger, active hi */
+       temp |= 0x00000400;             /* edge trigger, active hi */
+       if (PCPU_GET(cpuid) == 0)
+               temp |= APIC_LVT_MSET;  /* masked till later */
 
        lapic.lvt_lint1 = temp;

-- 

John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.20030904153444.jhb>