[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] x86: restore (optional) forwarding of PCI SERR induced NMI to Dom0


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-unstable <patchbot@xxxxxxx>
  • Date: Tue, 22 Jan 2013 19:22:11 +0000
  • Delivery-date: Tue, 22 Jan 2013 19:22:40 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User Jan Beulich <jbeulich@xxxxxxxx>
# Date 1358843590 -3600
# Node ID 5af4f2ab06f33ce441fa550333a9049c09a9ef28
# Parent  4b476378fc35e776196c29dc0e24b71529393a4c
x86: restore (optional) forwarding of PCI SERR induced NMI to Dom0

c/s 22949:54fe1011f86b removed the forwarding of NMIs to Dom0 when they
were caused by PCI SERR. NMI buttons as well as BMCs (like HP's iLO)
may however want such events to be seen in Dom0 (e.g. to trigger a
dump).

Therefore restore most of the functionality which named c/s removed
(adjusted for subsequent changes, and adjusting the public interface to
use the modern term, retaining the old one for backwards
compatibility).

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Acked-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Acked-by: Keir Fraser <keir@xxxxxxx>
---


diff -r 4b476378fc35 -r 5af4f2ab06f3 xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c      Mon Jan 21 17:03:10 2013 +0000
+++ b/xen/arch/x86/traps.c      Tue Jan 22 09:33:10 2013 +0100
@@ -3089,6 +3089,7 @@ static void nmi_mce_softirq(void)
 static void pci_serr_softirq(void)
 {
     printk("\n\nNMI - PCI system error (SERR)\n");
+    outb(inb(0x61) & 0x0b, 0x61); /* re-enable the PCI SERR error line. */
 }
 
 void async_exception_cleanup(struct vcpu *curr)
@@ -3135,9 +3136,20 @@ static void pci_serr_error(struct cpu_us
 {
     outb((inb(0x61) & 0x0f) | 0x04, 0x61); /* clear-and-disable the PCI SERR 
error line. */
 
-    /* Would like to print a diagnostic here but can't call printk()
-       from NMI context -- raise a softirq instead. */
-    raise_softirq(PCI_SERR_SOFTIRQ);
+    switch ( opt_nmi[0] )
+    {
+    case 'd': /* 'dom0' */
+        nmi_dom0_report(_XEN_NMIREASON_pci_serr);
+    case 'i': /* 'ignore' */
+        /* Would like to print a diagnostic here but can't call printk()
+           from NMI context -- raise a softirq instead. */
+        raise_softirq(PCI_SERR_SOFTIRQ);
+        break;
+    default:  /* 'fatal' */
+        console_force_unlock();
+        printk("\n\nNMI - PCI system error (SERR)\n");
+        fatal_trap(TRAP_nmi, regs);
+    }
 }
 
 static void io_check_error(struct cpu_user_regs *regs)
diff -r 4b476378fc35 -r 5af4f2ab06f3 xen/include/public/nmi.h
--- a/xen/include/public/nmi.h  Mon Jan 21 17:03:10 2013 +0000
+++ b/xen/include/public/nmi.h  Tue Jan 22 09:33:10 2013 +0100
@@ -36,9 +36,14 @@
  /* I/O-check error reported via ISA port 0x61, bit 6. */
 #define _XEN_NMIREASON_io_error     0
 #define XEN_NMIREASON_io_error      (1UL << _XEN_NMIREASON_io_error)
+ /* PCI SERR reported via ISA port 0x61, bit 7. */
+#define _XEN_NMIREASON_pci_serr     1
+#define XEN_NMIREASON_pci_serr      (1UL << _XEN_NMIREASON_pci_serr)
+#if __XEN_INTERFACE_VERSION__ < 0x00040300 /* legacy alias of the above */
  /* Parity error reported via ISA port 0x61, bit 7. */
 #define _XEN_NMIREASON_parity_error 1
 #define XEN_NMIREASON_parity_error  (1UL << _XEN_NMIREASON_parity_error)
+#endif
  /* Unknown hardware-generated NMI. */
 #define _XEN_NMIREASON_unknown      2
 #define XEN_NMIREASON_unknown       (1UL << _XEN_NMIREASON_unknown)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.