iommu/vt-d: Fixes for v6.18-rc1
Subsystems (2)
Lu Baolu
maintainerHi 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(-)
Signature · 1 line
2.43.0
Lu Baolu
maintainerPATCH 1/1 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.
--- drivers/iommu/intel/iommu.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/iommu/intel/iommu.h +2 -1
@@ -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))
Signature · 1 line
2.43.0
Quoted 2 lines · Lu Baolu
Lu Baolu (1):
iommu/vt-d: Disallow dirty tracking if incoherent page walk
Applied, thanks Baolu.