* [PATCH 0/7] [PULL REQUEST] Intel IOMMU updates for v6.18
@ 2025-09-18 5:01 Lu Baolu
2025-09-18 5:01 ` [PATCH 1/7] iommu/vt-d: Replace snprintf with scnprintf in dmar_latency_snapshot() Lu Baolu
` (7 more replies)
0 siblings, 8 replies; 9+ messages in thread
From: Lu Baolu @ 2025-09-18 5:01 UTC (permalink / raw)
To: Joerg Roedel; +Cc: iommu, linux-kernel
Hi Joerg,
The following changes have been queued for v6.18-rc1. They are about new
features and code refactoring, including:
- IOMMU driver updated to the latest VT-d specification
- Don't enable PRS if PDS isn't supported
- Replace snprintf with scnprintf
- Fix legacy mode page table dump through debugfs
- Miscellaneous cleanups
These patches are based on v6.17-rc6. Please consider them for the
iommu/vt-d branch.
Best regards,
baolu
Lu Baolu (4):
iommu/vt-d: Remove LPIG from page group response descriptor
iommu/vt-d: PRS isn't usable if PDS isn't supported
iommu/vt-d: Removal of Advanced Fault Logging
iommu/vt-d: debugfs: Avoid dumping context command register
Seyediman Seyedarab (1):
iommu/vt-d: Replace snprintf with scnprintf in dmar_latency_snapshot()
Vineeth Pillai (Google) (1):
iommu/vt-d: debugfs: Fix legacy mode page table dump logic
Yury Norov (NVIDIA) (1):
iommu/vt-d: Drop unused cap_super_offset()
drivers/iommu/intel/debugfs.c | 29 +++++++++++++++++------------
drivers/iommu/intel/iommu.c | 2 +-
drivers/iommu/intel/iommu.h | 4 ----
drivers/iommu/intel/perf.c | 10 ++++------
drivers/iommu/intel/perf.h | 5 ++---
drivers/iommu/intel/prq.c | 7 ++-----
6 files changed, 26 insertions(+), 31 deletions(-)
--
2.43.0
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/7] iommu/vt-d: Replace snprintf with scnprintf in dmar_latency_snapshot()
2025-09-18 5:01 [PATCH 0/7] [PULL REQUEST] Intel IOMMU updates for v6.18 Lu Baolu
@ 2025-09-18 5:01 ` Lu Baolu
2025-09-18 5:01 ` [PATCH 2/7] iommu/vt-d: debugfs: Fix legacy mode page table dump logic Lu Baolu
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Lu Baolu @ 2025-09-18 5:01 UTC (permalink / raw)
To: Joerg Roedel; +Cc: iommu, linux-kernel
From: Seyediman Seyedarab <ImanDevel@gmail.com>
snprintf() returns the number of bytes that would have been written, not
the number actually written. Using this for offset tracking can cause
buffer overruns if truncation occurs.
Replace snprintf() with scnprintf() to ensure the offset stays within
bounds.
Since scnprintf() never returns a negative value, and zero is not possible
in this context because 'bytes' starts at 0 and 'size - bytes' is
DEBUG_BUFFER_SIZE in the first call, which is large enough to hold the
string literals used, the return value is always positive. An integer
overflow is also completely out of reach here due to the small and fixed
buffer size. The error check in latency_show_one() is therefore
unnecessary. Remove it and make dmar_latency_snapshot() return void.
Signed-off-by: Seyediman Seyedarab <ImanDevel@gmail.com>
Link: https://lore.kernel.org/r/20250731225048.131364-1-ImanDevel@gmail.com
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
---
drivers/iommu/intel/debugfs.c | 10 ++--------
drivers/iommu/intel/perf.c | 10 ++++------
drivers/iommu/intel/perf.h | 5 ++---
3 files changed, 8 insertions(+), 17 deletions(-)
diff --git a/drivers/iommu/intel/debugfs.c b/drivers/iommu/intel/debugfs.c
index affbf4a1558d..65d2f792f0f7 100644
--- a/drivers/iommu/intel/debugfs.c
+++ b/drivers/iommu/intel/debugfs.c
@@ -648,17 +648,11 @@ DEFINE_SHOW_ATTRIBUTE(ir_translation_struct);
static void latency_show_one(struct seq_file *m, struct intel_iommu *iommu,
struct dmar_drhd_unit *drhd)
{
- int ret;
-
seq_printf(m, "IOMMU: %s Register Base Address: %llx\n",
iommu->name, drhd->reg_base_addr);
- ret = dmar_latency_snapshot(iommu, debug_buf, DEBUG_BUFFER_SIZE);
- if (ret < 0)
- seq_puts(m, "Failed to get latency snapshot");
- else
- seq_puts(m, debug_buf);
- seq_puts(m, "\n");
+ dmar_latency_snapshot(iommu, debug_buf, DEBUG_BUFFER_SIZE);
+ seq_printf(m, "%s\n", debug_buf);
}
static int latency_show(struct seq_file *m, void *v)
diff --git a/drivers/iommu/intel/perf.c b/drivers/iommu/intel/perf.c
index adc4de6bbd88..dceeadc3ee7c 100644
--- a/drivers/iommu/intel/perf.c
+++ b/drivers/iommu/intel/perf.c
@@ -113,7 +113,7 @@ static char *latency_type_names[] = {
" svm_prq"
};
-int dmar_latency_snapshot(struct intel_iommu *iommu, char *str, size_t size)
+void dmar_latency_snapshot(struct intel_iommu *iommu, char *str, size_t size)
{
struct latency_statistic *lstat = iommu->perf_statistic;
unsigned long flags;
@@ -122,7 +122,7 @@ int dmar_latency_snapshot(struct intel_iommu *iommu, char *str, size_t size)
memset(str, 0, size);
for (i = 0; i < COUNTS_NUM; i++)
- bytes += snprintf(str + bytes, size - bytes,
+ bytes += scnprintf(str + bytes, size - bytes,
"%s", latency_counter_names[i]);
spin_lock_irqsave(&latency_lock, flags);
@@ -130,7 +130,7 @@ int dmar_latency_snapshot(struct intel_iommu *iommu, char *str, size_t size)
if (!dmar_latency_enabled(iommu, i))
continue;
- bytes += snprintf(str + bytes, size - bytes,
+ bytes += scnprintf(str + bytes, size - bytes,
"\n%s", latency_type_names[i]);
for (j = 0; j < COUNTS_NUM; j++) {
@@ -156,11 +156,9 @@ int dmar_latency_snapshot(struct intel_iommu *iommu, char *str, size_t size)
break;
}
- bytes += snprintf(str + bytes, size - bytes,
+ bytes += scnprintf(str + bytes, size - bytes,
"%12lld", val);
}
}
spin_unlock_irqrestore(&latency_lock, flags);
-
- return bytes;
}
diff --git a/drivers/iommu/intel/perf.h b/drivers/iommu/intel/perf.h
index df9a36942d64..1d4baad7e852 100644
--- a/drivers/iommu/intel/perf.h
+++ b/drivers/iommu/intel/perf.h
@@ -40,7 +40,7 @@ void dmar_latency_disable(struct intel_iommu *iommu, enum latency_type type);
bool dmar_latency_enabled(struct intel_iommu *iommu, enum latency_type type);
void dmar_latency_update(struct intel_iommu *iommu, enum latency_type type,
u64 latency);
-int dmar_latency_snapshot(struct intel_iommu *iommu, char *str, size_t size);
+void dmar_latency_snapshot(struct intel_iommu *iommu, char *str, size_t size);
#else
static inline int
dmar_latency_enable(struct intel_iommu *iommu, enum latency_type type)
@@ -64,9 +64,8 @@ dmar_latency_update(struct intel_iommu *iommu, enum latency_type type, u64 laten
{
}
-static inline int
+static inline void
dmar_latency_snapshot(struct intel_iommu *iommu, char *str, size_t size)
{
- return 0;
}
#endif /* CONFIG_DMAR_PERF */
--
2.43.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/7] iommu/vt-d: debugfs: Fix legacy mode page table dump logic
2025-09-18 5:01 [PATCH 0/7] [PULL REQUEST] Intel IOMMU updates for v6.18 Lu Baolu
2025-09-18 5:01 ` [PATCH 1/7] iommu/vt-d: Replace snprintf with scnprintf in dmar_latency_snapshot() Lu Baolu
@ 2025-09-18 5:01 ` Lu Baolu
2025-09-18 5:02 ` [PATCH 3/7] iommu/vt-d: Drop unused cap_super_offset() Lu Baolu
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Lu Baolu @ 2025-09-18 5:01 UTC (permalink / raw)
To: Joerg Roedel; +Cc: iommu, linux-kernel
From: "Vineeth Pillai (Google)" <vineeth@bitbyteword.org>
In legacy mode, SSPTPTR is ignored if TT is not 00b or 01b. SSPTPTR
maybe uninitialized or zero in that case and may cause oops like:
Oops: general protection fault, probably for non-canonical address
0xf00087d3f000f000: 0000 [#1] SMP NOPTI
CPU: 2 UID: 0 PID: 786 Comm: cat Not tainted 6.16.0 #191 PREEMPT(voluntary)
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.17.0-5.fc42 04/01/2014
RIP: 0010:pgtable_walk_level+0x98/0x150
RSP: 0018:ffffc90000f279c0 EFLAGS: 00010206
RAX: 0000000040000000 RBX: ffffc90000f27ab0 RCX: 000000000000001e
RDX: 0000000000000003 RSI: f00087d3f000f000 RDI: f00087d3f0010000
RBP: ffffc90000f27a00 R08: ffffc90000f27a98 R09: 0000000000000002
R10: 0000000000000000 R11: 0000000000000000 R12: f00087d3f000f000
R13: 0000000000000000 R14: 0000000040000000 R15: ffffc90000f27a98
FS: 0000764566dcb740(0000) GS:ffff8881f812c000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000764566d44000 CR3: 0000000109d81003 CR4: 0000000000772ef0
PKRU: 55555554
Call Trace:
<TASK>
pgtable_walk_level+0x88/0x150
domain_translation_struct_show.isra.0+0x2d9/0x300
dev_domain_translation_struct_show+0x20/0x40
seq_read_iter+0x12d/0x490
...
Avoid walking the page table if TT is not 00b or 01b.
Fixes: 2b437e804566 ("iommu/vt-d: debugfs: Support dumping a specified page table")
Signed-off-by: Vineeth Pillai (Google) <vineeth@bitbyteword.org>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Link: https://lore.kernel.org/r/20250814163153.634680-1-vineeth@bitbyteword.org
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
---
drivers/iommu/intel/debugfs.c | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/drivers/iommu/intel/debugfs.c b/drivers/iommu/intel/debugfs.c
index 65d2f792f0f7..38790ff50977 100644
--- a/drivers/iommu/intel/debugfs.c
+++ b/drivers/iommu/intel/debugfs.c
@@ -435,8 +435,21 @@ static int domain_translation_struct_show(struct seq_file *m,
}
pgd &= VTD_PAGE_MASK;
} else { /* legacy mode */
- pgd = context->lo & VTD_PAGE_MASK;
- agaw = context->hi & 7;
+ u8 tt = (u8)(context->lo & GENMASK_ULL(3, 2)) >> 2;
+
+ /*
+ * According to Translation Type(TT),
+ * get the page table pointer(SSPTPTR).
+ */
+ switch (tt) {
+ case CONTEXT_TT_MULTI_LEVEL:
+ case CONTEXT_TT_DEV_IOTLB:
+ pgd = context->lo & VTD_PAGE_MASK;
+ agaw = context->hi & 7;
+ break;
+ default:
+ goto iommu_unlock;
+ }
}
seq_printf(m, "Device %04x:%02x:%02x.%x ",
--
2.43.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 3/7] iommu/vt-d: Drop unused cap_super_offset()
2025-09-18 5:01 [PATCH 0/7] [PULL REQUEST] Intel IOMMU updates for v6.18 Lu Baolu
2025-09-18 5:01 ` [PATCH 1/7] iommu/vt-d: Replace snprintf with scnprintf in dmar_latency_snapshot() Lu Baolu
2025-09-18 5:01 ` [PATCH 2/7] iommu/vt-d: debugfs: Fix legacy mode page table dump logic Lu Baolu
@ 2025-09-18 5:02 ` Lu Baolu
2025-09-18 5:02 ` [PATCH 4/7] iommu/vt-d: Remove LPIG from page group response descriptor Lu Baolu
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Lu Baolu @ 2025-09-18 5:02 UTC (permalink / raw)
To: Joerg Roedel; +Cc: iommu, linux-kernel
From: "Yury Norov (NVIDIA)" <yury.norov@gmail.com>
The macro is unused. Drop the dead code.
Signed-off-by: Yury Norov (NVIDIA) <yury.norov@gmail.com>
Link: https://lore.kernel.org/r/20250913015024.81186-1-yury.norov@gmail.com
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
---
drivers/iommu/intel/iommu.h | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/iommu/intel/iommu.h b/drivers/iommu/intel/iommu.h
index d09b92871659..7da1cf88ce80 100644
--- a/drivers/iommu/intel/iommu.h
+++ b/drivers/iommu/intel/iommu.h
@@ -173,8 +173,6 @@
#define cap_pgsel_inv(c) (((c) >> 39) & 1)
#define cap_super_page_val(c) (((c) >> 34) & 0xf)
-#define cap_super_offset(c) (((find_first_bit(&cap_super_page_val(c), 4)) \
- * OFFSET_STRIDE) + 21)
#define cap_fault_reg_offset(c) ((((c) >> 24) & 0x3ff) * 16)
#define cap_max_fault_reg_offset(c) \
--
2.43.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 4/7] iommu/vt-d: Remove LPIG from page group response descriptor
2025-09-18 5:01 [PATCH 0/7] [PULL REQUEST] Intel IOMMU updates for v6.18 Lu Baolu
` (2 preceding siblings ...)
2025-09-18 5:02 ` [PATCH 3/7] iommu/vt-d: Drop unused cap_super_offset() Lu Baolu
@ 2025-09-18 5:02 ` Lu Baolu
2025-09-18 5:02 ` [PATCH 5/7] iommu/vt-d: PRS isn't usable if PDS isn't supported Lu Baolu
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Lu Baolu @ 2025-09-18 5:02 UTC (permalink / raw)
To: Joerg Roedel; +Cc: iommu, linux-kernel
Bit 66 in the page group response descriptor used to be the LPIG (Last
Page in Group), but it was marked as Reserved since Specification 4.0.
Remove programming on this bit to make it consistent with the latest
specification.
Existing hardware all treats bit 66 of the page group response descriptor
as "ignored", therefore this change doesn't break any existing hardware.
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Link: https://lore.kernel.org/r/20250901053943.1708490-1-baolu.lu@linux.intel.com
---
drivers/iommu/intel/iommu.h | 1 -
drivers/iommu/intel/prq.c | 7 ++-----
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/iommu/intel/iommu.h b/drivers/iommu/intel/iommu.h
index 7da1cf88ce80..21d79414385c 100644
--- a/drivers/iommu/intel/iommu.h
+++ b/drivers/iommu/intel/iommu.h
@@ -460,7 +460,6 @@ enum {
#define QI_PGRP_PASID(pasid) (((u64)(pasid)) << 32)
/* Page group response descriptor QW1 */
-#define QI_PGRP_LPIG(x) (((u64)(x)) << 2)
#define QI_PGRP_IDX(idx) (((u64)(idx)) << 3)
diff --git a/drivers/iommu/intel/prq.c b/drivers/iommu/intel/prq.c
index 52570e42a14c..ff63c228e6e1 100644
--- a/drivers/iommu/intel/prq.c
+++ b/drivers/iommu/intel/prq.c
@@ -151,8 +151,7 @@ static void handle_bad_prq_event(struct intel_iommu *iommu,
QI_PGRP_PASID_P(req->pasid_present) |
QI_PGRP_RESP_CODE(result) |
QI_PGRP_RESP_TYPE;
- desc.qw1 = QI_PGRP_IDX(req->prg_index) |
- QI_PGRP_LPIG(req->lpig);
+ desc.qw1 = QI_PGRP_IDX(req->prg_index);
qi_submit_sync(iommu, &desc, 1, 0);
}
@@ -379,19 +378,17 @@ void intel_iommu_page_response(struct device *dev, struct iopf_fault *evt,
struct iommu_fault_page_request *prm;
struct qi_desc desc;
bool pasid_present;
- bool last_page;
u16 sid;
prm = &evt->fault.prm;
sid = PCI_DEVID(bus, devfn);
pasid_present = prm->flags & IOMMU_FAULT_PAGE_REQUEST_PASID_VALID;
- last_page = prm->flags & IOMMU_FAULT_PAGE_REQUEST_LAST_PAGE;
desc.qw0 = QI_PGRP_PASID(prm->pasid) | QI_PGRP_DID(sid) |
QI_PGRP_PASID_P(pasid_present) |
QI_PGRP_RESP_CODE(msg->code) |
QI_PGRP_RESP_TYPE;
- desc.qw1 = QI_PGRP_IDX(prm->grpid) | QI_PGRP_LPIG(last_page);
+ desc.qw1 = QI_PGRP_IDX(prm->grpid);
desc.qw2 = 0;
desc.qw3 = 0;
--
2.43.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 5/7] iommu/vt-d: PRS isn't usable if PDS isn't supported
2025-09-18 5:01 [PATCH 0/7] [PULL REQUEST] Intel IOMMU updates for v6.18 Lu Baolu
` (3 preceding siblings ...)
2025-09-18 5:02 ` [PATCH 4/7] iommu/vt-d: Remove LPIG from page group response descriptor Lu Baolu
@ 2025-09-18 5:02 ` Lu Baolu
2025-09-18 5:02 ` [PATCH 6/7] iommu/vt-d: Removal of Advanced Fault Logging Lu Baolu
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Lu Baolu @ 2025-09-18 5:02 UTC (permalink / raw)
To: Joerg Roedel; +Cc: iommu, linux-kernel
The specification, Section 7.10, "Software Steps to Drain Page Requests &
Responses," requires software to submit an Invalidation Wait Descriptor
(inv_wait_dsc) with the Page-request Drain (PD=1) flag set, along with
the Invalidation Wait Completion Status Write flag (SW=1). It then waits
for the Invalidation Wait Descriptor's completion.
However, the PD field in the Invalidation Wait Descriptor is optional, as
stated in Section 6.5.2.9, "Invalidation Wait Descriptor":
"Page-request Drain (PD): Remapping hardware implementations reporting
Page-request draining as not supported (PDS = 0 in ECAP_REG) treat this
field as reserved."
This implies that if the IOMMU doesn't support the PDS capability, software
can't drain page requests and group responses as expected.
Do not enable PCI/PRI if the IOMMU doesn't support PDS.
Reported-by: Joel Granados <joel.granados@kernel.org>
Closes: https://lore.kernel.org/r/20250909-jag-pds-v1-1-ad8cba0e494e@kernel.org
Fixes: 66ac4db36f4c ("iommu/vt-d: Add page request draining support")
Cc: stable@vger.kernel.org
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Link: https://lore.kernel.org/r/20250915062946.120196-1-baolu.lu@linux.intel.com
---
drivers/iommu/intel/iommu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
index 9c3ab9d9f69a..92759a8f8330 100644
--- a/drivers/iommu/intel/iommu.c
+++ b/drivers/iommu/intel/iommu.c
@@ -3812,7 +3812,7 @@ static struct iommu_device *intel_iommu_probe_device(struct device *dev)
}
if (info->ats_supported && ecap_prs(iommu->ecap) &&
- pci_pri_supported(pdev))
+ ecap_pds(iommu->ecap) && pci_pri_supported(pdev))
info->pri_supported = 1;
}
}
--
2.43.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 6/7] iommu/vt-d: Removal of Advanced Fault Logging
2025-09-18 5:01 [PATCH 0/7] [PULL REQUEST] Intel IOMMU updates for v6.18 Lu Baolu
` (4 preceding siblings ...)
2025-09-18 5:02 ` [PATCH 5/7] iommu/vt-d: PRS isn't usable if PDS isn't supported Lu Baolu
@ 2025-09-18 5:02 ` Lu Baolu
2025-09-18 5:02 ` [PATCH 7/7] iommu/vt-d: debugfs: Avoid dumping context command register Lu Baolu
2025-09-19 7:43 ` [PATCH 0/7] [PULL REQUEST] Intel IOMMU updates for v6.18 Joerg Roedel
7 siblings, 0 replies; 9+ messages in thread
From: Lu Baolu @ 2025-09-18 5:02 UTC (permalink / raw)
To: Joerg Roedel; +Cc: iommu, linux-kernel
The advanced fault logging has been removed from the specification since
v4.0. Linux doesn't implement advanced fault logging functionality, but
it currently dumps the advanced logging registers through debugfs. Remove
the dumping of these advanced fault logging registers through debugfs to
avoid potential access to non-present registers.
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Link: https://lore.kernel.org/r/20250917024850.143801-1-baolu.lu@linux.intel.com
---
drivers/iommu/intel/debugfs.c | 1 -
drivers/iommu/intel/iommu.h | 1 -
2 files changed, 2 deletions(-)
diff --git a/drivers/iommu/intel/debugfs.c b/drivers/iommu/intel/debugfs.c
index 38790ff50977..765edb3740e2 100644
--- a/drivers/iommu/intel/debugfs.c
+++ b/drivers/iommu/intel/debugfs.c
@@ -63,7 +63,6 @@ static const struct iommu_regset iommu_regs_64[] = {
IOMMU_REGSET_ENTRY(ECAP),
IOMMU_REGSET_ENTRY(RTADDR),
IOMMU_REGSET_ENTRY(CCMD),
- IOMMU_REGSET_ENTRY(AFLOG),
IOMMU_REGSET_ENTRY(PHMBASE),
IOMMU_REGSET_ENTRY(PHMLIMIT),
IOMMU_REGSET_ENTRY(IQH),
diff --git a/drivers/iommu/intel/iommu.h b/drivers/iommu/intel/iommu.h
index 21d79414385c..ef7a1ae8e0db 100644
--- a/drivers/iommu/intel/iommu.h
+++ b/drivers/iommu/intel/iommu.h
@@ -77,7 +77,6 @@
#define DMAR_FEDATA_REG 0x3c /* Fault event interrupt data register */
#define DMAR_FEADDR_REG 0x40 /* Fault event interrupt addr register */
#define DMAR_FEUADDR_REG 0x44 /* Upper address register */
-#define DMAR_AFLOG_REG 0x58 /* Advanced Fault control */
#define DMAR_PMEN_REG 0x64 /* Enable Protected Memory Region */
#define DMAR_PLMBASE_REG 0x68 /* PMRR Low addr */
#define DMAR_PLMLIMIT_REG 0x6c /* PMRR low limit */
--
2.43.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 7/7] iommu/vt-d: debugfs: Avoid dumping context command register
2025-09-18 5:01 [PATCH 0/7] [PULL REQUEST] Intel IOMMU updates for v6.18 Lu Baolu
` (5 preceding siblings ...)
2025-09-18 5:02 ` [PATCH 6/7] iommu/vt-d: Removal of Advanced Fault Logging Lu Baolu
@ 2025-09-18 5:02 ` Lu Baolu
2025-09-19 7:43 ` [PATCH 0/7] [PULL REQUEST] Intel IOMMU updates for v6.18 Joerg Roedel
7 siblings, 0 replies; 9+ messages in thread
From: Lu Baolu @ 2025-09-18 5:02 UTC (permalink / raw)
To: Joerg Roedel; +Cc: iommu, linux-kernel
The register-based cache invalidation interface is in the process of being
replaced by the queued invalidation interface. The VT-d architecture
allows hardware implementations with a queued invalidation interface to
not implement the registers used for cache invalidation. Currently, the
debugfs interface dumps the Context Command Register unconditionally,
which is not reasonable.
Remove it to avoid potential access to non-present registers.
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Link: https://lore.kernel.org/r/20250917025051.143853-1-baolu.lu@linux.intel.com
---
drivers/iommu/intel/debugfs.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/iommu/intel/debugfs.c b/drivers/iommu/intel/debugfs.c
index 765edb3740e2..617fd81a80f0 100644
--- a/drivers/iommu/intel/debugfs.c
+++ b/drivers/iommu/intel/debugfs.c
@@ -62,7 +62,6 @@ static const struct iommu_regset iommu_regs_64[] = {
IOMMU_REGSET_ENTRY(CAP),
IOMMU_REGSET_ENTRY(ECAP),
IOMMU_REGSET_ENTRY(RTADDR),
- IOMMU_REGSET_ENTRY(CCMD),
IOMMU_REGSET_ENTRY(PHMBASE),
IOMMU_REGSET_ENTRY(PHMLIMIT),
IOMMU_REGSET_ENTRY(IQH),
--
2.43.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 0/7] [PULL REQUEST] Intel IOMMU updates for v6.18
2025-09-18 5:01 [PATCH 0/7] [PULL REQUEST] Intel IOMMU updates for v6.18 Lu Baolu
` (6 preceding siblings ...)
2025-09-18 5:02 ` [PATCH 7/7] iommu/vt-d: debugfs: Avoid dumping context command register Lu Baolu
@ 2025-09-19 7:43 ` Joerg Roedel
7 siblings, 0 replies; 9+ messages in thread
From: Joerg Roedel @ 2025-09-19 7:43 UTC (permalink / raw)
To: Lu Baolu; +Cc: iommu, linux-kernel
On Thu, Sep 18, 2025 at 01:01:57PM +0800, Lu Baolu wrote:
> Lu Baolu (4):
> iommu/vt-d: Remove LPIG from page group response descriptor
> iommu/vt-d: PRS isn't usable if PDS isn't supported
> iommu/vt-d: Removal of Advanced Fault Logging
> iommu/vt-d: debugfs: Avoid dumping context command register
>
> Seyediman Seyedarab (1):
> iommu/vt-d: Replace snprintf with scnprintf in dmar_latency_snapshot()
>
> Vineeth Pillai (Google) (1):
> iommu/vt-d: debugfs: Fix legacy mode page table dump logic
>
> Yury Norov (NVIDIA) (1):
> iommu/vt-d: Drop unused cap_super_offset()
>
> drivers/iommu/intel/debugfs.c | 29 +++++++++++++++++------------
> drivers/iommu/intel/iommu.c | 2 +-
> drivers/iommu/intel/iommu.h | 4 ----
> drivers/iommu/intel/perf.c | 10 ++++------
> drivers/iommu/intel/perf.h | 5 ++---
> drivers/iommu/intel/prq.c | 7 ++-----
> 6 files changed, 26 insertions(+), 31 deletions(-)
Applied, thanks Baolu.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2025-09-19 7:43 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-18 5:01 [PATCH 0/7] [PULL REQUEST] Intel IOMMU updates for v6.18 Lu Baolu
2025-09-18 5:01 ` [PATCH 1/7] iommu/vt-d: Replace snprintf with scnprintf in dmar_latency_snapshot() Lu Baolu
2025-09-18 5:01 ` [PATCH 2/7] iommu/vt-d: debugfs: Fix legacy mode page table dump logic Lu Baolu
2025-09-18 5:02 ` [PATCH 3/7] iommu/vt-d: Drop unused cap_super_offset() Lu Baolu
2025-09-18 5:02 ` [PATCH 4/7] iommu/vt-d: Remove LPIG from page group response descriptor Lu Baolu
2025-09-18 5:02 ` [PATCH 5/7] iommu/vt-d: PRS isn't usable if PDS isn't supported Lu Baolu
2025-09-18 5:02 ` [PATCH 6/7] iommu/vt-d: Removal of Advanced Fault Logging Lu Baolu
2025-09-18 5:02 ` [PATCH 7/7] iommu/vt-d: debugfs: Avoid dumping context command register Lu Baolu
2025-09-19 7:43 ` [PATCH 0/7] [PULL REQUEST] Intel IOMMU updates for v6.18 Joerg Roedel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox