Skip to content

Commit be9be07

Browse files
Jacob PanKAGA-KOKO
authored andcommitted
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 <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent ce0a928 commit be9be07

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2251,6 +2251,8 @@
22512251
no_x2apic_optout
22522252
BIOS x2APIC opt-out request will be ignored
22532253
nopost disable Interrupt Posting
2254+
posted_msi
2255+
enable MSIs delivered as posted interrupts
22542256

22552257
iomem= Disable strict checking of access to MMIO memory
22562258
strict regions from userspace.

arch/x86/include/asm/irq_remapping.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,13 @@ static inline struct irq_domain *arch_get_ir_parent_domain(void)
5050
return x86_vector_domain;
5151
}
5252

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+
5360
#else /* CONFIG_IRQ_REMAP */
5461

5562
static inline bool irq_remapping_cap(enum irq_remap_cap cap) { return 0; }

drivers/iommu/irq_remapping.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ int no_x2apic_optout;
2424

2525
int disable_irq_post = 0;
2626

27+
bool enable_posted_msi __ro_after_init;
28+
2729
static int disable_irq_remap;
2830
static struct irq_remap_ops *remap_ops;
2931

@@ -70,7 +72,8 @@ static __init int setup_irqremap(char *str)
7072
no_x2apic_optout = 1;
7173
else if (!strncmp(str, "nopost", 6))
7274
disable_irq_post = 1;
73-
75+
else if (IS_ENABLED(CONFIG_X86_POSTED_MSI) && !strncmp(str, "posted_msi", 10))
76+
enable_posted_msi = true;
7477
str += strcspn(str, ",");
7578
while (*str == ',')
7679
str++;

0 commit comments

Comments
 (0)