]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
iommu/vt-d: Make posted MSI an opt-in command line option
authorJacob Pan <jacob.jun.pan@linux.intel.com>
Tue, 23 Apr 2024 17:41:13 +0000 (10:41 -0700)
committerThomas Gleixner <tglx@linutronix.de>
Mon, 29 Apr 2024 22:54:43 +0000 (00:54 +0200)
Add a command line opt-in option for posted MSI if CONFIG_X86_POSTED_MSI=y.

Also introduce a helper function for testing if posted MSI is supported on
the platform.

Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20240423174114.526704-12-jacob.jun.pan@linux.intel.com
Documentation/admin-guide/kernel-parameters.txt
arch/x86/include/asm/irq_remapping.h
drivers/iommu/irq_remapping.c

index 902ecd92a29fbe83df18d32d1a8fe652c8277132..dfbe9fdf97e40cd3fd1ac93c09d195974b5575f9 100644 (file)
                        no_x2apic_optout
                                BIOS x2APIC opt-out request will be ignored
                        nopost  disable Interrupt Posting
+                       posted_msi
+                               enable MSIs delivered as posted interrupts
 
        iomem=          Disable strict checking of access to MMIO memory
                strict  regions from userspace.
index 7a2ed154a5e1f98c4876686babf251756b6153b2..5036f13ab69f632f7bed3a1449572b26feb5335c 100644 (file)
@@ -50,6 +50,13 @@ static inline struct irq_domain *arch_get_ir_parent_domain(void)
        return x86_vector_domain;
 }
 
+extern bool enable_posted_msi;
+
+static inline bool posted_msi_supported(void)
+{
+       return enable_posted_msi && irq_remapping_cap(IRQ_POSTING_CAP);
+}
+
 #else  /* CONFIG_IRQ_REMAP */
 
 static inline bool irq_remapping_cap(enum irq_remap_cap cap) { return 0; }
index ee59647c20501ec29792a19b381b0d133313cac8..056fec6991bc866449a294e6ee58b63457f063a2 100644 (file)
@@ -24,6 +24,8 @@ int no_x2apic_optout;
 
 int disable_irq_post = 0;
 
+bool enable_posted_msi __ro_after_init;
+
 static int disable_irq_remap;
 static struct irq_remap_ops *remap_ops;
 
@@ -70,7 +72,8 @@ static __init int setup_irqremap(char *str)
                        no_x2apic_optout = 1;
                else if (!strncmp(str, "nopost", 6))
                        disable_irq_post = 1;
-
+               else if (IS_ENABLED(CONFIG_X86_POSTED_MSI) && !strncmp(str, "posted_msi", 10))
+                       enable_posted_msi = true;
                str += strcspn(str, ",");
                while (*str == ',')
                        str++;