x86: fix probe_nr_irqs for xen
authorYinghai Lu <yhlu.kernel@gmail.com>
Thu, 21 Aug 2008 20:10:09 +0000 (13:10 -0700)
committerIngo Molnar <mingo@elte.hu>
Thu, 16 Oct 2008 14:52:59 +0000 (16:52 +0200)
otherwise Xen is _completely_ unusable with 5 or more VCPUs.
(when !CONFIG_HAVE_SPARSE_IRQ).

based on Alex Nixon's patch.

also add +1 offset after redir_entries

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Acked-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Acked-by: Alex Nixon <alex.nixon@citrix.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/kernel/io_apic.c

index 4e44fd1f466ef122d53db3b1df34d04b651d6a31..d28128e0392c94c8bd0325fc4b9c4c239c0c81f6 100644 (file)
@@ -3625,16 +3625,21 @@ int __init probe_nr_irqs(void)
 {
        int idx;
        int nr = 0;
+#ifndef CONFIG_XEN
+       int nr_min = 32;
+#else
+       int nr_min = NR_IRQS;
+#endif
 
        for (idx = 0; idx < nr_ioapics; idx++)
-               nr += io_apic_get_redir_entries(idx);
+               nr += io_apic_get_redir_entries(idx) + 1;
 
        /* double it for hotplug and msi and nmi */
        nr <<= 1;
 
        /* something wrong ? */
-       if (nr < 32)
-               nr = 32;
+       if (nr < nr_min)
+               nr = nr_min;
 
        return nr;
 }
This page took 0.026532 seconds and 5 git commands to generate.