From: Thomas Gleixner <tglx@linutronix.de>
To: LKML <linux-kernel@vger.kernel.org>
Cc: x86@kernel.org, Lu Baolu <baolu.lu@linux.intel.com>,
Joerg Roedel <joro@8bytes.org>, Luigi Rizzo <lrizzo@google.com>
Subject: [patch 3/3] x86/irq_remapping: Sanitize posted_msi_supported()
Date: Tue, 25 Nov 2025 11:20:25 +0100 (CET) [thread overview]
Message-ID: <20251125102000.763427030@linutronix.de> (raw)
In-Reply-To: 20251125101912.564125647@linutronix.de
posted_msi_supported() is a misnomer as it actually checks whether it is
enabled or not. Aside of that this does not take CONFIG_X86_POSTED_MSI into
account which is required to actually use it.
Rename it to posted_msi_enabled() and make the return value depend on
CONFIG_X86_POSTED_MSI, which allows the compiler to eliminate the related
dead code and data if disabled:
text data bss dec hex filename
10046 701 3296 14043 36db drivers/iommu/intel/irq_remapping.o
9904 413 3296 13613 352d drivers/iommu/intel/irq_remapping.o
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Lu Baolu <baolu.lu@linux.intel.com>
Cc: Joerg Roedel <joro@8bytes.org>
---
arch/x86/include/asm/irq_remapping.h | 5 +++--
drivers/iommu/intel/irq_remapping.c | 4 ++--
2 files changed, 5 insertions(+), 4 deletions(-)
--- a/arch/x86/include/asm/irq_remapping.h
+++ b/arch/x86/include/asm/irq_remapping.h
@@ -67,9 +67,10 @@ static inline struct irq_domain *arch_ge
extern bool enable_posted_msi;
-static inline bool posted_msi_supported(void)
+static inline bool posted_msi_enabled(void)
{
- return enable_posted_msi && irq_remapping_cap(IRQ_POSTING_CAP);
+ return IS_ENABLED(CONFIG_X86_POSTED_MSI) &&
+ enable_posted_msi && irq_remapping_cap(IRQ_POSTING_CAP);
}
#else /* CONFIG_IRQ_REMAP */
--- a/drivers/iommu/intel/irq_remapping.c
+++ b/drivers/iommu/intel/irq_remapping.c
@@ -1368,7 +1368,7 @@ static void intel_irq_remapping_prepare_
break;
case X86_IRQ_ALLOC_TYPE_PCI_MSI:
case X86_IRQ_ALLOC_TYPE_PCI_MSIX:
- if (posted_msi_supported()) {
+ if (posted_msi_enabled()) {
prepare_irte_posted(irte);
data->irq_2_iommu.posted_msi = 1;
}
@@ -1460,7 +1460,7 @@ static int intel_irq_remapping_alloc(str
irq_data->hwirq = (index << 16) + i;
irq_data->chip_data = ird;
- if (posted_msi_supported() &&
+ if (posted_msi_enabled() &&
((info->type == X86_IRQ_ALLOC_TYPE_PCI_MSI) ||
(info->type == X86_IRQ_ALLOC_TYPE_PCI_MSIX)))
irq_data->chip = &intel_ir_chip_post_msi;
prev parent reply other threads:[~2025-11-25 10:20 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-25 10:20 [patch 0/3] x86/irq: Bugfix and cleanup for posted MSI interrupts Thomas Gleixner
2025-11-25 10:20 ` [patch 1/3] x86/msi: Make irq_retrigger() functional for posted MSI Thomas Gleixner
2025-11-25 17:54 ` Luigi Rizzo
2025-11-25 19:04 ` Thomas Gleixner
2025-11-25 10:20 ` [patch 2/3] x86/irq: Cleanup posted MSI code Thomas Gleixner
2025-11-25 10:20 ` Thomas Gleixner [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251125102000.763427030@linutronix.de \
--to=tglx@linutronix.de \
--cc=baolu.lu@linux.intel.com \
--cc=joro@8bytes.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lrizzo@google.com \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox