Commit 052c0bff authored by Yinghai Lu's avatar Yinghai Lu Committed by Ingo Molnar

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: default avatarYinghai Lu <yhlu.kernel@gmail.com>
Acked-by: default avatarJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Acked-by: default avatarAlex Nixon <alex.nixon@citrix.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent a2d332fa
...@@ -3625,16 +3625,21 @@ int __init probe_nr_irqs(void) ...@@ -3625,16 +3625,21 @@ int __init probe_nr_irqs(void)
{ {
int idx; int idx;
int nr = 0; int nr = 0;
#ifndef CONFIG_XEN
int nr_min = 32;
#else
int nr_min = NR_IRQS;
#endif
for (idx = 0; idx < nr_ioapics; idx++) 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 */ /* double it for hotplug and msi and nmi */
nr <<= 1; nr <<= 1;
/* something wrong ? */ /* something wrong ? */
if (nr < 32) if (nr < nr_min)
nr = 32; nr = nr_min;
return nr; return nr;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment