WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] x86/IO-APIC: clear remoteIRR in clear_IO_APIC_pin()

To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] x86/IO-APIC: clear remoteIRR in clear_IO_APIC_pin()
From: "Jan Beulich" <JBeulich@xxxxxxxxxx>
Date: Fri, 19 Aug 2011 16:17:55 +0100
Delivery-date: Fri, 19 Aug 2011 08:19:41 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
It was found that in a crash scenario, the remoteIRR bit in an IO-APIC
RTE could be left set, causing problems when bringing up a kdump
kernel. While this generally is most important to be taken care of in
the new kernel (which usually would be a native one), it still seems
desirable to also address this problem in Xen so that (a) the problem
doesn't bite Xen when used as a secondary emergency kernel and (b) an
attempt is being made to save un-fixed secondary kernels from running
into said problem.

Based on a Linux patch from suresh.b.siddha@xxxxxxxxxx

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>

--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -382,11 +382,46 @@ static void clear_IO_APIC_pin(unsigned i
         return;
 
     /*
+     * Make sure the entry is masked and re-read the contents to check
+     * if it is a level triggered pin and if the remoteIRR is set.
+     */
+    if (!entry.mask) {
+        entry.mask = 1;
+        __ioapic_write_entry(apic, pin, FALSE, entry);
+    }
+    entry = __ioapic_read_entry(apic, pin, TRUE);
+
+    if (entry.irr) {
+        /* Make sure the trigger mode is set to level. */
+        if (!entry.trigger) {
+            entry.trigger = 1;
+            __ioapic_write_entry(apic, pin, TRUE, entry);
+        }
+        if (mp_ioapics[apic].mpc_apicver >= 0x20)
+            io_apic_eoi(apic, entry.vector);
+        else {
+            /*
+             * Mechanism by which we clear remoteIRR in this case is by
+             * changing the trigger mode to edge and back to level.
+             */
+            entry.trigger = 0;
+            __ioapic_write_entry(apic, pin, TRUE, entry);
+            entry.trigger = 1;
+            __ioapic_write_entry(apic, pin, TRUE, entry);
+        }
+    }
+
+    /*
      * Disable it in the IO-APIC irq-routing table:
      */
     memset(&entry, 0, sizeof(entry));
     entry.mask = 1;
     __ioapic_write_entry(apic, pin, TRUE, entry);
+
+    entry = __ioapic_read_entry(apic, pin, TRUE);
+    if (entry.irr)
+        printk(KERN_ERR "IO-APIC%02x-%u: Unable to reset IRR\n",
+               IO_APIC_ID(apic), pin);
 }
 
 static void clear_IO_APIC (void)



Attachment: x86-ioapic-clear-irr.patch
Description: Text document

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] x86/IO-APIC: clear remoteIRR in clear_IO_APIC_pin(), Jan Beulich <=