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

[Xen-devel] Xen on machines with non-contiguous io-apics



(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

 


Rackspace

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