All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] iommu/vt-d: Disallow dirty tracking if incoherent page walk
@ 2025-09-24  8:34 Lu Baolu
  2025-09-24 12:04 ` Jason Gunthorpe
  2025-09-26  2:42 ` Baolu Lu
  0 siblings, 2 replies; 5+ messages in thread
From: Lu Baolu @ 2025-09-24  8:34 UTC (permalink / raw)
  To: Joerg Roedel, Will Deacon, Robin Murphy, Kevin Tian,
	Jason Gunthorpe
  Cc: iommu, linux-kernel, Lu Baolu

Dirty page tracking relies on the IOMMU atomically updating the dirty bit
in the paging-structure entry. For this operation to succeed, the paging-
structure memory must be coherent between the IOMMU and the CPU. In
another word, if the iommu page walk is incoherent, dirty page tracking
doesn't work.

The Intel VT-d specification, Section 3.10 "Snoop Behavior" states:

"Remapping hardware encountering the need to atomically update A/EA/D bits
 in a paging-structure entry that is not snooped will result in a non-
 recoverable fault."

To prevent an IOMMU from being incorrectly configured for dirty page
tracking when it is operating in an incoherent mode, mark SSADS as
supported only when both ecap_slads and ecap_smpwc are supported.

Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
---
 drivers/iommu/intel/iommu.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/iommu/intel/iommu.h b/drivers/iommu/intel/iommu.h
index d09b92871659..2c261c069001 100644
--- a/drivers/iommu/intel/iommu.h
+++ b/drivers/iommu/intel/iommu.h
@@ -541,7 +541,8 @@ enum {
 #define pasid_supported(iommu)	(sm_supported(iommu) &&			\
 				 ecap_pasid((iommu)->ecap))
 #define ssads_supported(iommu) (sm_supported(iommu) &&                 \
-				ecap_slads((iommu)->ecap))
+				ecap_slads((iommu)->ecap) &&           \
+				ecap_smpwc(iommu->ecap))
 #define nested_supported(iommu)	(sm_supported(iommu) &&			\
 				 ecap_nest((iommu)->ecap))
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread
* [PATCH 0/1] [PULL REQUEST] iommu/vt-d: Fixes for v6.18-rc1
@ 2025-09-26  2:41 Lu Baolu
  2025-09-26  2:41 ` [PATCH 1/1] iommu/vt-d: Disallow dirty tracking if incoherent page walk Lu Baolu
  0 siblings, 1 reply; 5+ messages in thread
From: Lu Baolu @ 2025-09-26  2:41 UTC (permalink / raw)
  To: Joerg Roedel; +Cc: iommu, linux-kernel

Hi Joerg,

The following fix has been queued for the Intel iommu driver. It aims to
solve the following problem:

- Disallow dirty tracking if page walk is incoherent

This fix is not so critical for v6.17-rc. Considering the upcoming merge
window, it would be fine to include them with other patches for v6.18.
Please consider it.

Best regards,
baolu

Lu Baolu (1):
  iommu/vt-d: Disallow dirty tracking if incoherent page walk

 drivers/iommu/intel/iommu.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-09-26  2:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-24  8:34 [PATCH 1/1] iommu/vt-d: Disallow dirty tracking if incoherent page walk Lu Baolu
2025-09-24 12:04 ` Jason Gunthorpe
2025-09-25  3:01   ` Baolu Lu
2025-09-26  2:42 ` Baolu Lu
  -- strict thread matches above, loose matches on Subject: below --
2025-09-26  2:41 [PATCH 0/1] [PULL REQUEST] iommu/vt-d: Fixes for v6.18-rc1 Lu Baolu
2025-09-26  2:41 ` [PATCH 1/1] iommu/vt-d: Disallow dirty tracking if incoherent page walk Lu Baolu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.