iommu/vt-d: Enable write protect for supervisor SVM
authorJacob Pan <jacob.jun.pan@linux.intel.com>
Tue, 2 Mar 2021 10:13:57 +0000 (02:13 -0800)
committerJoerg Roedel <jroedel@suse.de>
Thu, 18 Mar 2021 10:42:46 +0000 (11:42 +0100)
commitf68c7f539b6e9712e941212ab95a1feb5a0bf3b3
tree4794fc37921f6c6f1ea78febf86ef016bf7bde18
parent6ca69e5841f01ccbfa45e56577e1b33e14e53504
iommu/vt-d: Enable write protect for supervisor SVM

Write protect bit, when set, inhibits supervisor writes to the read-only
pages. In supervisor shared virtual addressing (SVA), where page tables
are shared between CPU and DMA, IOMMU PASID entry WPE bit should match
CR0.WP bit in the CPU.
This patch sets WPE bit for supervisor PASIDs if CR0.WP is set.

Signed-off-by: Sanjay Kumar <sanjay.k.kumar@intel.com>
Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
Acked-by: Lu Baolu <baolu.lu@linux.intel.com>
Link: https://lore.kernel.org/r/1614680040-1989-2-git-send-email-jacob.jun.pan@linux.intel.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/intel/pasid.c