Skip to content

Commit 6f5dc76

Browse files
jgunthorpejoergroedel
authored andcommitted
iommu/vt-d: Restore WO permissions on second-level paging entries
VT-D HW can do WO permissions on the second-stage but not the first-stage page table formats. The commit eea53c5 ("iommu/vt-d: Remove WO permissions on second-level paging entries") wanted to make this uniform for VT-D by disabling the support for WO permissions in the second-stage. This isn't consistent with how other drivers are working. Instead if the underlying HW can support WO, it should. For instance AMD already supports WO on its second stage (v1) format and not its first (v2). If WO support needs to be discoverable it should be done through an iommu_domain capability flag. Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> Reviewed-by: Kevin Tian <kevin.tian@intel.com> Link: https://lore.kernel.org/r/0-v1-c26553717e90+65f-iommu_vtd_ss_wo_jgg@nvidia.com Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent 8ffd015 commit 6f5dc76

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/iommu/intel/iommu.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1681,9 +1681,8 @@ __domain_mapping(struct dmar_domain *domain, unsigned long iov_pfn,
16811681
}
16821682

16831683
attr = prot & (DMA_PTE_READ | DMA_PTE_WRITE | DMA_PTE_SNP);
1684-
attr |= DMA_FL_PTE_PRESENT;
16851684
if (domain->use_first_level) {
1686-
attr |= DMA_FL_PTE_US | DMA_FL_PTE_ACCESS;
1685+
attr |= DMA_FL_PTE_PRESENT | DMA_FL_PTE_US | DMA_FL_PTE_ACCESS;
16871686
if (prot & DMA_PTE_WRITE)
16881687
attr |= DMA_FL_PTE_DIRTY;
16891688
}

0 commit comments

Comments
 (0)