x86/apic: Remove X86_IRQ_ALLOC_CONTIGUOUS_VECTORS
authorThomas Gleixner <tglx@linutronix.de>
Fri, 11 Nov 2022 13:55:17 +0000 (14:55 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 17 Nov 2022 14:15:22 +0000 (15:15 +0100)
Now that the PCI/MSI core code does early checking for multi-MSI support
X86_IRQ_ALLOC_CONTIGUOUS_VECTORS is not required anymore.

Remove the flag and rely on MSI_FLAG_MULTI_PCI_MSI.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/20221111122015.865042356@linutronix.de
arch/x86/include/asm/irqdomain.h
arch/x86/kernel/apic/msi.c
arch/x86/kernel/apic/vector.c
drivers/iommu/amd/iommu.c
drivers/iommu/intel/irq_remapping.c
drivers/pci/controller/pci-hyperv.c

index 125c23b7bad394b61c06f1266330149e3a975e0f..30c325c235c0d7d7903261b7f76ebb97a0b2a84c 100644 (file)
@@ -7,9 +7,7 @@
 
 #ifdef CONFIG_X86_LOCAL_APIC
 enum {
-       /* Allocate contiguous CPU vectors */
-       X86_IRQ_ALLOC_CONTIGUOUS_VECTORS                = 0x1,
-       X86_IRQ_ALLOC_LEGACY                            = 0x2,
+       X86_IRQ_ALLOC_LEGACY                            = 0x1,
 };
 
 extern int x86_fwspec_is_ioapic(struct irq_fwspec *fwspec);
index 7517eb05bdc1a22c999b4598bd0f228113259ad8..248a6a5c0ad8a9d970baf3bcc5b9fe2303e49e90 100644 (file)
@@ -161,12 +161,10 @@ int pci_msi_prepare(struct irq_domain *domain, struct device *dev, int nvec,
                    msi_alloc_info_t *arg)
 {
        init_irq_alloc_info(arg, NULL);
-       if (to_pci_dev(dev)->msix_enabled) {
+       if (to_pci_dev(dev)->msix_enabled)
                arg->type = X86_IRQ_ALLOC_TYPE_PCI_MSIX;
-       } else {
+       else
                arg->type = X86_IRQ_ALLOC_TYPE_PCI_MSI;
-               arg->flags |= X86_IRQ_ALLOC_CONTIGUOUS_VECTORS;
-       }
 
        return 0;
 }
index 3e6f6b448f6aaa4eb19b1976162f05cd30b094cf..c1efebd27e6cd3ae5466db09d9fd69224f325199 100644 (file)
@@ -539,10 +539,6 @@ static int x86_vector_alloc_irqs(struct irq_domain *domain, unsigned int virq,
        if (disable_apic)
                return -ENXIO;
 
-       /* Currently vector allocator can't guarantee contiguous allocations */
-       if ((info->flags & X86_IRQ_ALLOC_CONTIGUOUS_VECTORS) && nr_irqs > 1)
-               return -ENOSYS;
-
        /*
         * Catch any attempt to touch the cascade interrupt on a PIC
         * equipped system.
index 8ece86484b275fdd085d9e331d5bf6aaa404364c..72dfe57f5802f49cf051f0ccce8ab7b1905cac83 100644 (file)
@@ -3297,13 +3297,6 @@ static int irq_remapping_alloc(struct irq_domain *domain, unsigned int virq,
        if (nr_irqs > 1 && info->type != X86_IRQ_ALLOC_TYPE_PCI_MSI)
                return -EINVAL;
 
-       /*
-        * With IRQ remapping enabled, don't need contiguous CPU vectors
-        * to support multiple MSI interrupts.
-        */
-       if (info->type == X86_IRQ_ALLOC_TYPE_PCI_MSI)
-               info->flags &= ~X86_IRQ_ALLOC_CONTIGUOUS_VECTORS;
-
        sbdf = get_devid(info);
        if (sbdf < 0)
                return -EINVAL;
index 0b80a272e9a74a728c6b93865d7c66b3df24f36a..a914eba787ac83138508d6f816015bf1becbedfe 100644 (file)
@@ -1337,13 +1337,6 @@ static int intel_irq_remapping_alloc(struct irq_domain *domain,
        if (nr_irqs > 1 && info->type != X86_IRQ_ALLOC_TYPE_PCI_MSI)
                return -EINVAL;
 
-       /*
-        * With IRQ remapping enabled, don't need contiguous CPU vectors
-        * to support multiple MSI interrupts.
-        */
-       if (info->type == X86_IRQ_ALLOC_TYPE_PCI_MSI)
-               info->flags &= ~X86_IRQ_ALLOC_CONTIGUOUS_VECTORS;
-
        ret = irq_domain_alloc_irqs_parent(domain, virq, nr_irqs, arg);
        if (ret < 0)
                return ret;
index ba64284eaf9faa64eebab38963b3b12f4da0d1dc..1dee55d16a4d371d077e45f10abcd451a6ce5d6e 100644 (file)
@@ -611,20 +611,7 @@ static unsigned int hv_msi_get_int_vector(struct irq_data *data)
        return cfg->vector;
 }
 
-static int hv_msi_prepare(struct irq_domain *domain, struct device *dev,
-                         int nvec, msi_alloc_info_t *info)
-{
-       int ret = pci_msi_prepare(domain, dev, nvec, info);
-
-       /*
-        * By using the interrupt remapper in the hypervisor IOMMU, contiguous
-        * CPU vectors is not needed for multi-MSI
-        */
-       if (info->type == X86_IRQ_ALLOC_TYPE_PCI_MSI)
-               info->flags &= ~X86_IRQ_ALLOC_CONTIGUOUS_VECTORS;
-
-       return ret;
-}
+#define hv_msi_prepare         pci_msi_prepare
 
 /**
  * hv_arch_irq_unmask() - "Unmask" the IRQ by setting its current