Skip to content

Commit 57f5504

Browse files
LuBaolujoergroedel
authored andcommitted
iommu/vt-d: Disallow dirty tracking if incoherent page walk
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. Fixes: f35f22c ("iommu/vt-d: Access/Dirty bit support for SS domains") Signed-off-by: Lu Baolu <[email protected]> Reviewed-by: Jason Gunthorpe <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent 5bd5ab5 commit 57f5504

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/iommu/intel/iommu.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,8 @@ enum {
537537
#define pasid_supported(iommu) (sm_supported(iommu) && \
538538
ecap_pasid((iommu)->ecap))
539539
#define ssads_supported(iommu) (sm_supported(iommu) && \
540-
ecap_slads((iommu)->ecap))
540+
ecap_slads((iommu)->ecap) && \
541+
ecap_smpwc(iommu->ecap))
541542
#define nested_supported(iommu) (sm_supported(iommu) && \
542543
ecap_nest((iommu)->ecap))
543544

0 commit comments

Comments
 (0)