When using an APIC do not set nr_irqs based on a factor of nr_irqs_gsi
(currently x8), and instead do so exclusively based on the amount of
available vectors on the system.
There's no point in setting nr_irqs to a value higher than the
available set of vectors, as vector allocation will fail anyway.
Fixes: e99d45da8a ('x86/x2apic: properly implement cluster mode')
Signed-off-by: Roger Pau Monné <[email protected]>
---
xen/arch/x86/irq.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 7f75ec8bcc..e3b0bee527 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -426,8 +426,7 @@ int __init init_irq_data(void)
(x2apic_enabled && !x2apic_phys) ? x2apic_max_cluster_id + 1
: num_present_cpus();
- nr_irqs = cpu_has_apic ? max(vec_spaces * NR_DYNAMIC_VECTORS,
- 8 * nr_irqs_gsi)
+ nr_irqs = cpu_has_apic ? vec_spaces * NR_DYNAMIC_VECTORS
: nr_irqs_gsi;
}
else if ( nr_irqs < 16 )
--
2.36.1