Skip to contentSkip to conversation

iommu/vt-d: Disallow SVA if page walk is not coherent

PATCH Applied Lu Baolu 5 participants 5 messages Jul 16 – Jul 21

Subsystems (3)
lore
Share & tools
lore

Lu Baolu

author maintainer
#0 lore raw

PATCH 1/1 iommu/vt-d: Disallow SVA if page walk is not coherent

Hardware implementations report Scalable-Mode Page-walk Coherency Support via the SMPWCS field in the extended capability register. If the hardware does not support page-walk coherency, a clflush is required every time the page table entries (which are walked by the IOMMU hardware) are updated.

In the SVA case, page tables are managed by the CPU mm core, not by the IOMMU driver. Because the IOMMU driver has no way of knowing whether the CPU page table management code has ensured coherency via clflush, the driver must deny SVA if the hardware does not support coherent paging.

Fixes ff3dc6521f78 ("iommu/vt-d: Fix CPU and IOMMU SVM feature matching checks")
---
 drivers/iommu/intel/svm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/intel/svm.c +1 -1
index 0636987f03c8..432e35723ce9 100644
@@ -27,7 +27,7 @@
 
 void intel_svm_check(struct intel_iommu *iommu)
 {
-	if (!pasid_supported(iommu))
+	if (!pasid_supported(iommu) || !ecap_smpwc(iommu->ecap))
 		return;
 
 	if (cpu_feature_enabled(X86_FEATURE_GBPAGES) &&
Signature · 1 line
2.43.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Lu Baolu

Hardware implementations report Scalable-Mode Page-walk Coherency Support via the SMPWCS field in the extended capability register. If the hardware does not support page-walk coherency, a clflush is required every time the page table entries (which are walked by the IOMMU hardware) are updated.

In the SVA case, page tables are managed by the CPU mm core, not by the IOMMU driver. Because the IOMMU driver has no way of knowing whether the CPU page table management code has ensured coherency via clflush, the driver must deny SVA if the hardware does not support coherent paging.

Quoted 6 lines
Fixes ff3dc6521f78 ("iommu/vt-d: Fix CPU and IOMMU SVM feature matching checks")
---
 drivers/iommu/intel/svm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Jason

Reviewed-by on v1 1/1
#2 lore raw
In reply to Lu Baolu
Quoted 35 lines · Lu Baolu

Hardware implementations report Scalable-Mode Page-walk Coherency Support via the SMPWCS field in the extended capability register. If the hardware does not support page-walk coherency, a clflush is required every time the page table entries (which are walked by the IOMMU hardware) are updated.

In the SVA case, page tables are managed by the CPU mm core, not by the IOMMU driver. Because the IOMMU driver has no way of knowing whether the CPU page table management code has ensured coherency via clflush, the driver must deny SVA if the hardware does not support coherent paging.

Fixes ff3dc6521f78 ("iommu/vt-d: Fix CPU and IOMMU SVM feature matching checks")

---
drivers/iommu/intel/svm.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/intel/svm.c +1 -1
index 0636987f03c8..432e35723ce9 100644
@@ -27,7 +27,7 @@
 
 void intel_svm_check(struct intel_iommu *iommu)
 {
-	if (!pasid_supported(iommu))
+	if (!pasid_supported(iommu) || !ecap_smpwc(iommu->ecap))
 		return;
 
 	if (cpu_feature_enabled(X86_FEATURE_GBPAGES) &&
Signature · 1 line
2.43.0

Thanks,
Sami

Reviewed-by on v1 1/1
#3 lore raw
In reply to Lu Baolu
Quoted 16 lines

From: Lu Baolu <[email protected]>
Sent: Thursday, July 16, 2026 1:36 PM

Hardware implementations report Scalable-Mode Page-walk Coherency Support
via the SMPWCS field in the extended capability register. If the hardware does not support page-walk coherency, a clflush is required every time the page table entries (which are walked by the IOMMU hardware) are updated.

In the SVA case, page tables are managed by the CPU mm core, not by the IOMMU driver. Because the IOMMU driver has no way of knowing whether the
CPU page table management code has ensured coherency via clflush, the driver must deny SVA if the hardware does not support coherent paging.

Quoted 4 lines
Fixes ff3dc6521f78 ("iommu/vt-d: Fix CPU and IOMMU SVM feature

matching checks")

maintainer Applied
#4 lore raw
In reply to Lu Baolu
Quoted 6 lines · Lu Baolu

Hardware implementations report Scalable-Mode Page-walk Coherency Support via the SMPWCS field in the extended capability register. If the hardware does not support page-walk coherency, a clflush is required every time the page table entries (which are walked by the IOMMU hardware) are updated.

Quoted 6 lines

In the SVA case, page tables are managed by the CPU mm core, not by the IOMMU driver. Because the IOMMU driver has no way of knowing whether the CPU page table management code has ensured coherency via clflush, the driver must deny SVA if the hardware does not support coherent paging.

[...]

Applied to iommu (fixes), thanks!

[1/1] iommu/vt-d: Disallow SVA if page walk is not coherent

      https://git.kernel.org/iommu/c/780dfed68862

Cheers,

Signature · 5 lines
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev