Skip to content

Commit

Permalink
x86: fix probe_nr_irqs for xen
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Yinghai Lu authored and Ingo Molnar committed Oct 16, 2008
1 parent a2d332f commit 052c0bf
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions arch/x86/kernel/io_apic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 052c0bf

Please sign in to comment.