diff options
author | Yinghai Lu <yhlu.kernel@gmail.com> | 2008-08-21 16:10:09 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-10-16 10:52:59 -0400 |
commit | 052c0bff9b83a578654dfa513d6e3d0b3795f1e8 (patch) | |
tree | 4e5928ce37fa1567301e2316d0036b322e15362d /arch/x86/kernel/io_apic.c | |
parent | a2d332fa3445160519de03c350a59602ac1c3df9 (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>
Diffstat (limited to 'arch/x86/kernel/io_apic.c')
-rw-r--r-- | arch/x86/kernel/io_apic.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/arch/x86/kernel/io_apic.c b/arch/x86/kernel/io_apic.c index 4e44fd1f466e..d28128e0392c 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) | |||
3625 | { | 3625 | { |
3626 | int idx; | 3626 | int idx; |
3627 | int nr = 0; | 3627 | int nr = 0; |
3628 | #ifndef CONFIG_XEN | ||
3629 | int nr_min = 32; | ||
3630 | #else | ||
3631 | int nr_min = NR_IRQS; | ||
3632 | #endif | ||
3628 | 3633 | ||
3629 | for (idx = 0; idx < nr_ioapics; idx++) | 3634 | for (idx = 0; idx < nr_ioapics; idx++) |
3630 | nr += io_apic_get_redir_entries(idx); | 3635 | nr += io_apic_get_redir_entries(idx) + 1; |
3631 | 3636 | ||
3632 | /* double it for hotplug and msi and nmi */ | 3637 | /* double it for hotplug and msi and nmi */ |
3633 | nr <<= 1; | 3638 | nr <<= 1; |
3634 | 3639 | ||
3635 | /* something wrong ? */ | 3640 | /* something wrong ? */ |
3636 | if (nr < 32) | 3641 | if (nr < nr_min) |
3637 | nr = 32; | 3642 | nr = nr_min; |
3638 | 3643 | ||
3639 | return nr; | 3644 | return nr; |
3640 | } | 3645 | } |