From owner-freebsd-hackers@FreeBSD.ORG Thu Sep 4 12:34:29 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 85E0216A4BF for ; Thu, 4 Sep 2003 12:34:29 -0700 (PDT) Received: from mail.speakeasy.net (mail11.speakeasy.net [216.254.0.211]) by mx1.FreeBSD.org (Postfix) with ESMTP id B8E7343FE0 for ; Thu, 4 Sep 2003 12:34:28 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: (qmail 5702 invoked from network); 4 Sep 2003 19:34:28 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender )encrypted SMTP for ; 4 Sep 2003 19:34:28 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.9/8.12.9) with ESMTP id h84JYP6Y002657; Thu, 4 Sep 2003 15:34:25 -0400 (EDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.4 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: Date: Thu, 04 Sep 2003 15:34:44 -0400 (EDT) From: John Baldwin To: cjarvis@vci.com X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) cc: "freebsd-hackers@freebsd.org" Subject: Re: non reliable nmi X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2003 19:34:29 -0000 On 04-Sep-2003 cjarvis@vci.com wrote: > In <20030904131244.GU556@straylight.oblivion.bg>, on 09/04/03 > at 09:12 AM, Peter Pentchev 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 <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/