All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyrill Gorcunov <gorcunov@openvz.org>
To: Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>, Don Zickus <dzickus@redhat.com>,
	"Huang, Ying" <ying.huang@intel.com>,
	lkml <linux-kernel@vger.kernel.org>,
	"Maciej W. Rozycki" <macro@linux-mips.org>
Subject: [PATHC -tip 1/2] x86, nmi: Define a name for NMI control port
Date: Tue, 01 Mar 2011 00:40:10 +0300	[thread overview]
Message-ID: <4D6C163A.4010904@openvz.org> (raw)

Also add a comment anout why we need in-out operations.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
---
  arch/x86/include/asm/mach_traps.h |   18 +++++++++++++-----
  1 file changed, 13 insertions(+), 5 deletions(-)

Index: linux-2.6.git/arch/x86/include/asm/mach_traps.h
=====================================================================
--- linux-2.6.git.orig/arch/x86/include/asm/mach_traps.h
+++ linux-2.6.git/arch/x86/include/asm/mach_traps.h
@@ -8,6 +8,7 @@
  #include <asm/mc146818rtc.h>

  #define NMI_REASON_PORT		0x61
+#define NMI_ENABLE_PORT		0x70 /* Real-Time Clock Address Register as well */

  #define NMI_REASON_SERR		0x80
  #define NMI_REASON_IOCHK	0x40
@@ -30,12 +31,19 @@ static inline void reassert_nmi(void)
  		old_reg = current_lock_cmos_reg();
  	else
  		lock_cmos(0); /* register doesn't matter here */
-	outb(0x8f, 0x70);
-	inb(0x71);		/* dummy */
-	outb(0x0f, 0x70);
-	inb(0x71);		/* dummy */
+
+	/*
+	 * This will cause the NMI output to transition low
+	 * then high if there are any pending NMI sources. The
+	 * CPU's NMI input logic will then register a new NMI.
+	 */
+	outb(0x8f, NMI_ENABLE_PORT);
+	inb(0x71);	/* dummy */
+	outb(0x0f, NMI_ENABLE_PORT);
+	inb(0x71);	/* dummy */
+
  	if (old_reg >= 0)
-		outb(old_reg, 0x70);
+		outb(old_reg, NMI_ENABLE_PORT);
  	else
  		unlock_cmos();
  }
-- 
     Cyrill

             reply	other threads:[~2011-02-28 21:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-28 21:40 Cyrill Gorcunov [this message]
2011-03-01  7:57 ` [PATHC -tip 1/2] x86, nmi: Define a name for NMI control port Ingo Molnar
2011-03-01  8:22   ` Cyrill Gorcunov
2011-03-01 17:33   ` Cyrill Gorcunov
2011-03-01 17:35     ` Cyrill Gorcunov

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=4D6C163A.4010904@openvz.org \
    --to=gorcunov@openvz.org \
    --cc=dzickus@redhat.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=macro@linux-mips.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.