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

[Xen-changelog] [xen-unstable] x86: Fix max_gsi calculation on systems with discontiguous GSI space.



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1250683095 -3600
# Node ID 2b8b6ee95c939089a0a7182286c9a21f0acce8fe
# Parent  61c84f478e4d00c562f66ac3b8f0613cb3a4b608
x86: Fix max_gsi calculation on systems with discontiguous GSI space.

From: Steven Smith <steven.smith@xxxxxxxxxx>
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/arch/x86/io_apic.c |    5 +++++
 xen/arch/x86/mpparse.c |   13 +++++++++++++
 2 files changed, 18 insertions(+)

diff -r 61c84f478e4d -r 2b8b6ee95c93 xen/arch/x86/io_apic.c
--- a/xen/arch/x86/io_apic.c    Wed Aug 19 12:55:15 2009 +0100
+++ b/xen/arch/x86/io_apic.c    Wed Aug 19 12:58:15 2009 +0100
@@ -2349,6 +2349,8 @@ void dump_ioapic_irq_info(void)
     }
 }
 
+unsigned highest_gsi(void);
+
 void __init init_ioapic_mappings(void)
 {
     unsigned long ioapic_phys;
@@ -2390,6 +2392,9 @@ void __init init_ioapic_mappings(void)
             nr_irqs_gsi += nr_ioapic_registers[i];
         }
     }
+
+    nr_irqs_gsi = max(nr_irqs, highest_gsi());
+
     if ( !smp_found_config || skip_ioapic_setup || nr_irqs_gsi < 16 )
         nr_irqs_gsi = 16;
     else if ( nr_irqs_gsi > MAX_GSI_IRQS)
diff -r 61c84f478e4d -r 2b8b6ee95c93 xen/arch/x86/mpparse.c
--- a/xen/arch/x86/mpparse.c    Wed Aug 19 12:55:15 2009 +0100
+++ b/xen/arch/x86/mpparse.c    Wed Aug 19 12:58:15 2009 +0100
@@ -945,6 +945,19 @@ void __init mp_register_ioapic (
        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,

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
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®.