aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYinghai Lu <yhlu.kernel@gmail.com>2008-08-21 13:10:09 -0700
committerIngo Molnar <mingo@elte.hu>2008-10-16 16:52:59 +0200
commit052c0bff9b83a578654dfa513d6e3d0b3795f1e8 (patch)
tree4e5928ce37fa1567301e2316d0036b322e15362d
parenta2d332fa3445160519de03c350a59602ac1c3df9 (diff)
x86: fix probe_nr_irqs for xen
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>
-rw-r--r--arch/x86/kernel/io_apic.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/arch/x86/kernel/io_apic.c b/arch/x86/kernel/io_apic.c
index 4e44fd1f466..d28128e0392 100644
--- a/arch/x86/kernel/io_apic.c
+++ b/arch/x86/kernel/io_apic.c
@@ -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;
}