iommu/vt-d: Implement SVM_FLAG_SUPERVISOR_MODE for kernel access
authorDavid Woodhouse <David.Woodhouse@intel.com>
Thu, 15 Oct 2015 14:52:15 +0000 (15:52 +0100)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Thu, 15 Oct 2015 14:52:21 +0000 (15:52 +0100)
commit5cec753709adf1a20c8b15edf8e5245cf4fd4e82
tree9a600f9f1addd96d4ae4a536a53b33c0d58ba2e8
parent569e4f7782fb92d0e1b395b5fb01de642dd74dcf
iommu/vt-d: Implement SVM_FLAG_SUPERVISOR_MODE for kernel access

This is only usable for the static 1:1 mapping of physical memory.

Any access to vmalloc or module regions will require some way of doing
an IOTLB flush. It's theoretically possible to hook into the
tlb_flush_kernel_range() function, but that seems like overkill — most
of the addresses accessed through a kernel PASID *will* be in the 1:1
mapping.

If we really need to allow access to more interesting kernel regions,
then the answer will probably be an explicit IOTLB flush call after use,
akin to the DMA API's unmap function.

In fact, it might be worth introducing that sooner rather than later, and
making it just BUG() if the address isn't in the static 1:1 mapping.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/iommu/intel-svm.c
include/linux/intel-svm.h