Skip to content

Commit

Permalink
iommu/vt-d: Make posted MSI an opt-in command line option
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Jacob Pan authored and Thomas Gleixner committed Apr 29, 2024
1 parent ce0a928 commit be9be07
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Documentation/admin-guide/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2251,6 +2251,8 @@
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.
Expand Down
7 changes: 7 additions & 0 deletions arch/x86/include/asm/irq_remapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down
5 changes: 4 additions & 1 deletion drivers/iommu/irq_remapping.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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++;
Expand Down

0 comments on commit be9be07

Please sign in to comment.