Commit d58f97e3 authored by Yi Liu's avatar Yi Liu Committed by Jason Zeng
Browse files

iommu/vt-d: Set SSADE when attaching to a parent with dirty tracking

mainline inclusion
from mainline-v6.8-rc6
commit 1f0198fce68340e0da2d438f4ea9fc20d2c958da
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I938E2
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=1f0198fce68340e0da2d438f4ea9fc20d2c958da



--------------------------------

Should set the SSADE (Second Stage Access/Dirty bit Enable) bit of the
pasid entry when attaching a device to a nested domain if its parent
has already enabled dirty tracking.

Fixes: 111bf85c68f6 ("iommu/vt-d: Add helper to setup pasid nested translation")
Signed-off-by: default avatarYi Liu <yi.l.liu@intel.com>
Reviewed-by: default avatarJoao Martins <joao.m.martins@oracle.com>
Link: https://lore.kernel.org/r/20240208091414.28133-1-yi.l.liu@intel.com


Signed-off-by: default avatarLu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
Signed-off-by: default avatarJason Zeng <jason.zeng@intel.com>
parent 190ef2ed
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -657,6 +657,8 @@ int intel_pasid_setup_nested(struct intel_iommu *iommu, struct device *dev,
	pasid_set_domain_id(pte, did);
	pasid_set_address_width(pte, s2_domain->agaw);
	pasid_set_page_snoop(pte, !!ecap_smpwc(iommu->ecap));
	if (s2_domain->dirty_tracking)
		pasid_set_ssade(pte);
	pasid_set_translation_type(pte, PASID_ENTRY_PGTT_NESTED);
	pasid_set_present(pte);
	spin_unlock(&iommu->lock);