x86/apic/msi: Enable PCI/IMS
authorThomas Gleixner <tglx@linutronix.de>
Thu, 24 Nov 2022 23:26:32 +0000 (00:26 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Mon, 5 Dec 2022 21:22:35 +0000 (22:22 +0100)
Enable IMS in the domain init and allocation mapping code, but do not
enable it on the vector domain as discussed in various threads on LKML.

The interrupt remap domains can expand this setting like they do with
PCI multi MSI.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Acked-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20221124232327.022658817@linutronix.de
arch/x86/kernel/apic/msi.c

index 682f51a5b12def6b387d0b196d6865a41d0bbc31..35d5b8fb18efecc992c69266968464a829ebcaeb 100644 (file)
@@ -184,6 +184,7 @@ static int x86_msi_prepare(struct irq_domain *domain, struct device *dev,
                alloc->type = X86_IRQ_ALLOC_TYPE_PCI_MSI;
                return 0;
        case DOMAIN_BUS_PCI_DEVICE_MSIX:
+       case DOMAIN_BUS_PCI_DEVICE_IMS:
                alloc->type = X86_IRQ_ALLOC_TYPE_PCI_MSIX;
                return 0;
        default:
@@ -230,6 +231,10 @@ static bool x86_init_dev_msi_info(struct device *dev, struct irq_domain *domain,
        case DOMAIN_BUS_PCI_DEVICE_MSI:
        case DOMAIN_BUS_PCI_DEVICE_MSIX:
                break;
+       case DOMAIN_BUS_PCI_DEVICE_IMS:
+               if (!(pops->supported_flags & MSI_FLAG_PCI_IMS))
+                       return false;
+               break;
        default:
                WARN_ON_ONCE(1);
                return false;