Commit 1978fac2 authored by Jason Gunthorpe's avatar Jason Gunthorpe Committed by Joerg Roedel
Browse files

iommupt/x86: Set the dirty bit only for writable PTEs



AMD and VTD are historically different here, adopt the VTD version of
setting the D bit only on writable PTEs as it makes more sense.

Reviewed-by: default avatarLu Baolu <baolu.lu@linux.intel.com>
Reviewed-by: default avatarKevin Tian <kevin.tian@intel.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
Signed-off-by: default avatarJoerg Roedel <joerg.roedel@amd.com>
parent 5448c155
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -192,9 +192,9 @@ static inline int x86_64_pt_iommu_set_prot(struct pt_common *common,
{
	u64 pte;

	pte = X86_64_FMT_U | X86_64_FMT_A | X86_64_FMT_D;
	pte = X86_64_FMT_U | X86_64_FMT_A;
	if (iommu_prot & IOMMU_WRITE)
		pte |= X86_64_FMT_RW;
		pte |= X86_64_FMT_RW | X86_64_FMT_D;

	/*
	 * Ideally we'd have an IOMMU_ENCRYPTED flag set by higher levels to