]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
iommu/vt-d: Disallow SVA if page walk is not coherent
authorLu Baolu <baolu.lu@linux.intel.com>
Thu, 16 Jul 2026 05:35:53 +0000 (13:35 +0800)
committerWill Deacon <will@kernel.org>
Tue, 21 Jul 2026 11:27:32 +0000 (11:27 +0000)
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")
Cc: stable@vger.kernel.org
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Samiullah Khawaja <skhawaja@google.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Will Deacon <will@kernel.org>
drivers/iommu/intel/svm.c

index fea10acd4f021f5a1b62f87e5040e00ca6e59cd9..726f7b6d0bff799f503ebce4a6f405ae3db84930 100644 (file)
@@ -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) &&