On 30.06.2022 10:54, Roger Pau Monne wrote: > 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.
Only if in the earlier calculation you include hotplug CPUs. > --- 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; I wonder how useful it is to retain the !cpu_has_apic case here. I don't have much hope for Xen to work properly if APIC use was suppressed, and I'm unaware of x86-64 CPUs without APIC. Jan