[PATCH v1 0/6] iommu/arm-smmu: Auxiliary domain and per instance pagetables
From: Jordan Crouse
Date: Tue Jan 28 2020 - 17:16:35 EST
Some clients have a requirement to sandbox memory mappings for security and
advanced features like SVM. This series adds support to enable per-instance
pagetables as auxiliary domains in the arm-smmu driver and adds per-instance
support for the Adreno GPU.
This patchset builds on the split pagetable support from [1]. In that series the
TTBR1 address space is programmed for the default ("master") domain and enables
support for auxiliary domains. Each new auxiliary domain will allocate a
pagetable which the leaf driver can program through the usual IOMMU APIs. It can
also query the physical address of the pagetable.
In the SMMU driver the first auxiliary domain will enable and program the TTBR0
space. Subsequent auxiliary domains won't touch the hardware. Similarly when
the last auxiliary domain is detached the TTBR0 region will be disabled again.
In the Adreno driver each new file descriptor instance will create a new
auxiliary domain / pagetable and use it for all the memory allocations of that
instance. The driver will query the base address of each pagetable and switch
them dynamically using the built-in table switch capability of the GPU. If any
of these features fail the driver will automatically fall back to using the
default (global) pagetable.
This patchset had previously been submitted as [2] but has been significantly
modified since then.
Jordan
[1] https://lists.linuxfoundation.org/pipermail/iommu/2020-January/041438.html
[2] https://patchwork.freedesktop.org/series/57441/
Jordan Crouse (6):
iommu: Add DOMAIN_ATTR_PTBASE
arm/smmu: Add auxiliary domain support for arm-smmuv2
drm/msm/adreno: ADd support for IOMMU auxiliary domains
drm/msm: Add support to create target specific address spaces
drm/msm/gpu: Add ttbr0 to the memptrs
drm/msm/a6xx: Support per-instance pagetables
drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 89 +++++++++++++
drivers/gpu/drm/msm/msm_drv.c | 22 +++-
drivers/gpu/drm/msm/msm_gpu.h | 2 +
drivers/gpu/drm/msm/msm_iommu.c | 72 +++++++++++
drivers/gpu/drm/msm/msm_mmu.h | 3 +
drivers/gpu/drm/msm/msm_ringbuffer.h | 1 +
drivers/iommu/arm-smmu.c | 230 +++++++++++++++++++++++++++++++---
drivers/iommu/arm-smmu.h | 3 +
include/linux/iommu.h | 2 +
9 files changed, 405 insertions(+), 19 deletions(-)
--
2.7.4