From: Ahmed Abdelraoof <araoof@amazon.de>
To: David Woodhouse <dwmw2@infradead.org>,
Lu Baolu <baolu.lu@linux.intel.com>,
"Joerg Roedel (AMD)" <joro@8bytes.org>,
"Will Deacon" <will@kernel.org>,
Robin Murphy <robin.murphy@arm.com>,
"Ahmed Abdelraoof" <araoof@amazon.com>
Cc: <iommu@lists.linux.dev>, <linux-kernel@vger.kernel.org>
Subject: [PATCH] iommu/vt-d: Make DMA-fault page-table dump user-selectable
Date: Tue, 9 Jun 2026 14:37:59 +0000 [thread overview]
Message-ID: <20260609143806.69403-1-araoof@amazon.de> (raw)
From: Ahmed Abdelraoof <araoof@amazon.com>
The page-table dump was gated behind the hidden CONFIG_DMAR_DEBUG
symbol, only reachable by enabling the full INTEL_IOMMU_DEBUGFS
interface. That interface is explicitly flagged as not for production
and exposes far more IOMMU internals than a fault dump needs, so there
was no way to get this diagnostic from menuconfig on production kernel
without taking on the rest.
This patch renames it to CONFIG_DMAR_FAULT_DEBUG with a prompt and help
text so the fault dump can be enabled on its own, and updates all
references in iommu.c and dmar.h. INTEL_IOMMU_DEBUGFS still selects it,
so existing configs are unaffected; no functional change otherwise.
Signed-off-by: Ahmed Abdelraoof <araoof@amazon.com>
---
drivers/iommu/intel/Kconfig | 11 ++++++++---
drivers/iommu/intel/iommu.c | 2 +-
include/linux/dmar.h | 2 +-
3 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/drivers/iommu/intel/Kconfig b/drivers/iommu/intel/Kconfig
index 5471f814e073..59a05cefa728 100644
--- a/drivers/iommu/intel/Kconfig
+++ b/drivers/iommu/intel/Kconfig
@@ -6,8 +6,13 @@ config DMAR_TABLE
config DMAR_PERF
bool
-config DMAR_DEBUG
- bool
+config DMAR_FAULT_DEBUG
+ bool "Dump Intel IOMMU page tables on DMA fault"
+ depends on INTEL_IOMMU
+ help
+ On a DMA Remapping (DMAR) fault, walk the Root / Context /
+ PASID / second-level page-table entries for the faulting
+ source-id and IOVA and emit them via pr_info.
config INTEL_IOMMU
bool "Support for Intel IOMMU using DMA Remapping Devices"
@@ -39,7 +44,7 @@ config INTEL_IOMMU_DEBUGFS
bool "Export Intel IOMMU internals in Debugfs"
depends on IOMMU_DEBUGFS
select DMAR_PERF
- select DMAR_DEBUG
+ select DMAR_FAULT_DEBUG
help
!!!WARNING!!!
diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
index 4d0e65bc131d..7c28ef700dda 100644
--- a/drivers/iommu/intel/iommu.c
+++ b/drivers/iommu/intel/iommu.c
@@ -549,7 +549,7 @@ static void free_context_table(struct intel_iommu *iommu)
iommu->root_entry = NULL;
}
-#ifdef CONFIG_DMAR_DEBUG
+#ifdef CONFIG_DMAR_FAULT_DEBUG
static void pgtable_walk(struct intel_iommu *iommu, unsigned long pfn,
u8 bus, u8 devfn, struct dma_pte *parent, int level)
{
diff --git a/include/linux/dmar.h b/include/linux/dmar.h
index 692b2b445761..199cf01284fe 100644
--- a/include/linux/dmar.h
+++ b/include/linux/dmar.h
@@ -126,7 +126,7 @@ static inline int dmar_res_noop(struct acpi_dmar_header *hdr, void *arg)
return 0;
}
-#ifdef CONFIG_DMAR_DEBUG
+#ifdef CONFIG_DMAR_FAULT_DEBUG
void dmar_fault_dump_ptes(struct intel_iommu *iommu, u16 source_id,
unsigned long long addr, u32 pasid);
#else
--
2.47.3
Amazon Web Services Development Center Germany GmbH
Tamara-Danz-Str. 13
10243 Berlin
Geschaeftsfuehrung: Christof Hellmis, Andreas Stieger
Eingetragen am Amtsgericht Charlottenburg unter HRB 257764 B
Sitz: Berlin
Ust-ID: DE 365 538 597
reply other threads:[~2026-06-09 14:38 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20260609143806.69403-1-araoof@amazon.de \
--to=araoof@amazon.de \
--cc=araoof@amazon.com \
--cc=baolu.lu@linux.intel.com \
--cc=dwmw2@infradead.org \
--cc=iommu@lists.linux.dev \
--cc=joro@8bytes.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robin.murphy@arm.com \
--cc=will@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