iommu/vt-d: Enable write protect propagation from guest
authorJacob Pan <jacob.jun.pan@linux.intel.com>
Tue, 2 Mar 2021 10:13:58 +0000 (02:13 -0800)
committerJoerg Roedel <jroedel@suse.de>
Thu, 18 Mar 2021 10:42:46 +0000 (11:42 +0100)
commitbb0f61533dfd6aa815a2719720c77d13f840b683
tree2f4f9591d4551afb362fefa75bdf0b8d48a6cb66
parentf68c7f539b6e9712e941212ab95a1feb5a0bf3b3
iommu/vt-d: Enable write protect propagation from guest

Write protect bit, when set, inhibits supervisor writes to the read-only
pages. In guest supervisor shared virtual addressing (SVA), write-protect
should be honored upon guest bind supervisor PASID request.

This patch extends the VT-d portion of the IOMMU UAPI to include WP bit.
WPE bit of the  supervisor PASID entry will be set to match CPU CR0.WP bit.

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-3-git-send-email-jacob.jun.pan@linux.intel.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/intel/pasid.c
include/uapi/linux/iommu.h