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] Xen on machines with non-contiguous io-apics

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] Xen on machines with non-contiguous io-apics
From: Steven Smith <steven.smith@xxxxxxxxxx>
Date: Mon, 17 Aug 2009 10:17:28 +0100
Delivery-date: Mon, 17 Aug 2009 02:17:52 -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
(Mostly a bug report, with a kind of half-fix at the end.)

I have a test box with two IOAPICS which present non-contiguous GSIs
according to the ACPI tables (the first offers 0-24 and the second
32-56).  The latest xen-unstable with current pvops dom0 fails to boot
on this machine, because the dom0 kernel can't claim any GSIs above
48.  This is because the PHYSDEVOP_alloc_irq_vector implementation
won't let it get at anything above nr_irqs, which is just the sum of
the number of registers across all APICs.

The patch below fixes this by just setting nr_irqs to the highest GSI
offered by any IOAPIC.  I don't understand this stuff well enough to
say whether that's the right fix (and the patch isn't suitable for
applying, anyway), but it does make the machine boot.

Steven


diff -r 46b874d60375 xen/arch/x86/io_apic.c
--- a/xen/arch/x86/io_apic.c    Fri Aug 14 12:26:35 2009 +0100
+++ b/xen/arch/x86/io_apic.c    Fri Aug 14 17:18:19 2009 +0100
@@ -2209,6 +2209,8 @@
     }
 }
 
+unsigned highest_gsi(void);
+
 void __init init_ioapic_mappings(void)
 {
     unsigned long ioapic_phys;
@@ -2250,6 +2252,9 @@
             nr_irqs += nr_ioapic_registers[i];
         }
     }
+
+    nr_irqs = highest_gsi();
+
     if ( !smp_found_config || skip_ioapic_setup || nr_irqs < 16 )
         nr_irqs = 16;
     else if ( nr_irqs > PAGE_SIZE * 8 )
diff -r 46b874d60375 xen/arch/x86/mpparse.c
--- a/xen/arch/x86/mpparse.c    Fri Aug 14 12:26:35 2009 +0100
+++ b/xen/arch/x86/mpparse.c    Fri Aug 14 17:18:19 2009 +0100
@@ -945,6 +945,19 @@
        return;
 }
 
+unsigned highest_gsi(void)
+{
+    unsigned x;
+    unsigned res;
+
+    res = 0;
+    for (x = 0; x < nr_ioapics; x++) {
+        if (res < mp_ioapic_routing[x].gsi_end)
+            res = mp_ioapic_routing[x].gsi_end;
+    }
+    return res;
+}
+
 
 void __init mp_override_legacy_irq (
        u8                      bus_irq,

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>