genirq/msi: Provide constants for PCI/IMS support
authorThomas Gleixner <tglx@linutronix.de>
Thu, 24 Nov 2022 23:26:28 +0000 (00:26 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Mon, 5 Dec 2022 21:22:34 +0000 (22:22 +0100)
Provide the necessary constants for PCI/IMS support:

  - A new bus token for MSI irqdomain identification
  - A MSI feature flag for the MSI irqdomains to signal support
  - A secondary domain id

The latter expands the device internal domain pointer storage array from 1
to 2 entries. That extra pointer is mostly unused today, but the
alternative solutions would not be free either and would introduce more
complexity all over the place. Trade the 8bytes for simplicity.

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/20221124232326.846169830@linutronix.de
include/linux/irqdomain_defs.h
include/linux/msi.h
include/linux/msi_api.h

index 0b2d8a83e0d837c7ce5e3fab22904bafa97fee08..c29921fd8cd15a892adeb33752601d81747fda9c 100644 (file)
@@ -25,6 +25,7 @@ enum irq_domain_bus_token {
        DOMAIN_BUS_PCI_DEVICE_MSIX,
        DOMAIN_BUS_DMAR,
        DOMAIN_BUS_AMDVI,
+       DOMAIN_BUS_PCI_DEVICE_IMS,
 };
 
 #endif /* _LINUX_IRQDOMAIN_DEFS_H */
index 3cb15866ffbf7bbaa122b7a70a03ab70a034c318..a112b913fff949573a7c67bc686462ae84e21dcf 100644 (file)
@@ -559,6 +559,8 @@ enum {
        MSI_FLAG_MSIX_CONTIGUOUS        = (1 << 19),
        /* PCI/MSI-X vectors can be dynamically allocated/freed post MSI-X enable */
        MSI_FLAG_PCI_MSIX_ALLOC_DYN     = (1 << 20),
+       /* Support for PCI/IMS */
+       MSI_FLAG_PCI_IMS                = (1 << 21),
 };
 
 /**
index 5ae72d1912c46dd186281b6d6ddb514337311434..391087ad99b170a4cdbcb5178303dd8cbca22565 100644 (file)
@@ -15,6 +15,7 @@ struct device;
  */
 enum msi_domain_ids {
        MSI_DEFAULT_DOMAIN,
+       MSI_SECONDARY_DOMAIN,
        MSI_MAX_DEVICE_IRQDOMAINS,
 };