Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iommu/vt-d: Make posted MSI an opt-in command line option

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


authored by

Jacob Pan and committed by
Thomas Gleixner
be9be07b ce0a9287

+13 -1
+2
Documentation/admin-guide/kernel-parameters.txt
··· 2251 2251 no_x2apic_optout 2252 2252 BIOS x2APIC opt-out request will be ignored 2253 2253 nopost disable Interrupt Posting 2254 + posted_msi 2255 + enable MSIs delivered as posted interrupts 2254 2256 2255 2257 iomem= Disable strict checking of access to MMIO memory 2256 2258 strict regions from userspace.
+7
arch/x86/include/asm/irq_remapping.h
··· 50 50 return x86_vector_domain; 51 51 } 52 52 53 + extern bool enable_posted_msi; 54 + 55 + static inline bool posted_msi_supported(void) 56 + { 57 + return enable_posted_msi && irq_remapping_cap(IRQ_POSTING_CAP); 58 + } 59 + 53 60 #else /* CONFIG_IRQ_REMAP */ 54 61 55 62 static inline bool irq_remapping_cap(enum irq_remap_cap cap) { return 0; }
+4 -1
drivers/iommu/irq_remapping.c
··· 24 24 25 25 int disable_irq_post = 0; 26 26 27 + bool enable_posted_msi __ro_after_init; 28 + 27 29 static int disable_irq_remap; 28 30 static struct irq_remap_ops *remap_ops; 29 31 ··· 72 70 no_x2apic_optout = 1; 73 71 else if (!strncmp(str, "nopost", 6)) 74 72 disable_irq_post = 1; 75 - 73 + else if (IS_ENABLED(CONFIG_X86_POSTED_MSI) && !strncmp(str, "posted_msi", 10)) 74 + enable_posted_msi = true; 76 75 str += strcspn(str, ","); 77 76 while (*str == ',') 78 77 str++;