diff mbox series

[v2,5/6] x86/irq: print nr_irqs as limit on the number of MSI(-X) interrupts

Message ID 20220630085439.83193-6-roger.pau@citrix.com (mailing list archive)
State New, archived
Headers show
Series x86/irq: switch x2APIC default destination mode | expand

Commit Message

Roger Pau Monné June 30, 2022, 8:54 a.m. UTC
Using nr_irqs minus nr_irqs_gsi is misleading, as GSI interrupts are
not allocated unless requested by the hardware domain, so a hardware
domain could not use any GSI (or just one for the ACPI SCI), and hence
(almost) all nr_irqs will be available for MSI(-X) usage.

No functional difference, just affects the printed message.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/irq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jan Beulich July 5, 2022, 2:15 p.m. UTC | #1
On 30.06.2022 10:54, Roger Pau Monne wrote:
> Using nr_irqs minus nr_irqs_gsi is misleading, as GSI interrupts are
> not allocated unless requested by the hardware domain, so a hardware
> domain could not use any GSI (or just one for the ACPI SCI), and hence
> (almost) all nr_irqs will be available for MSI(-X) usage.

Looking at create_irq() I find a loop going from nr_irqs_gsi to nr_irqs.
Similar in get_free_pirq(). All lower numbers aren't eligible for use by
MSI/MSI-X. We can't allow the lower ones to be used for other than GSI
purposes because we can't know whether any device will become enabled
(perhaps long after boot) which wants to use a specific GSI.

Jan
diff mbox series

Patch

diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index b64d18c450..7f75ec8bcc 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -434,7 +434,7 @@  int __init init_irq_data(void)
         nr_irqs = 16;
 
     printk(XENLOG_INFO "IRQ limits: %u GSI, %u MSI/MSI-X\n",
-           nr_irqs_gsi, nr_irqs - nr_irqs_gsi);
+           nr_irqs_gsi, nr_irqs);
 
     for ( vector = 0; vector < X86_NR_VECTORS; ++vector )
         this_cpu(vector_irq)[vector] = INT_MIN;