Re: [PATCH] dt-bindings: iommu: renesas,ipmmu-vmsa: Sort compatible string in increasing number of the SoC

2020-08-10 Thread Geert Uytterhoeven
On Sun, Aug 9, 2020 at 9:35 PM Lad Prabhakar wrote: > Sort the items in the compatible string list in increasing number of SoC. > > Signed-off-by: Lad Prabhakar As my previous tag was conditional on fixing the sort order: Reviewed-by: Geert Uytterhoeven Gr{oetje,eeting}s,

[PATCH v12 06/13] dt-bindings: arm-smmu: Add compatible string for Adreno GPU SMMU

2020-08-10 Thread Jordan Crouse
Every Qcom Adreno GPU has an embedded SMMU for its own use. These devices depend on unique features such as split pagetables, different stall/halt requirements and other settings. Identify them with a compatible string so that they can be identified in the arm-smmu implementation specific code. Si

[PATCH v12 05/13] iommu/arm-smmu-qcom: Add implementation for the adreno GPU SMMU

2020-08-10 Thread Jordan Crouse
Add a special implementation for the SMMU attached to most Adreno GPU target triggered from the qcom,adreno-smmu compatible string. The new Adreno SMMU implementation will enable split pagetables (TTBR1) for the domain attached to the GPU device (SID 0) and hard code it context bank 0 so the GPU h

[PATCH v12 11/13] drm/msm/a6xx: Add support for per-instance pagetables

2020-08-10 Thread Jordan Crouse
Add support for using per-instance pagetables if all the dependencies are available. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 70 +++ drivers/gpu/drm/msm/adreno/a6xx_gpu.h | 1 + drivers/gpu/drm/msm/msm_ringbuffer.h | 1 + 3 files chang

[PATCH v12 01/13] iommu/arm-smmu: Pass io-pgtable config to implementation specific function

2020-08-10 Thread Jordan Crouse
Construct the io-pgtable config before calling the implementation specific init_context function and pass it so the implementation specific function can get a chance to change it before the io-pgtable is created. Signed-off-by: Jordan Crouse --- drivers/iommu/arm/arm-smmu/arm-smmu-impl.c | 3 +

[PATCH v12 08/13] drm/msm: Set the global virtual address range from the IOMMU domain

2020-08-10 Thread Jordan Crouse
Use the aperture settings from the IOMMU domain to set up the virtual address range for the GPU. This allows us to transparently deal with IOMMU side features (like split pagetables). Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/adreno/adreno_gpu.c | 13 +++-- drivers/gpu/drm/ms

[PATCH v12 09/13] drm/msm: Add support to create a local pagetable

2020-08-10 Thread Jordan Crouse
Add support to create a io-pgtable for use by targets that support per-instance pagetables. In order to support per-instance pagetables the GPU SMMU device needs to have the qcom,adreno-smmu compatible string and split pagetables enabled. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/msm

[PATCH v12 10/13] drm/msm: Add support for private address space instances

2020-08-10 Thread Jordan Crouse
Add support for allocating private address space instances. Targets that support per-context pagetables should implement their own function to allocate private address spaces. The default will return a pointer to the global address space. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/ms

[RFC v12 13/13] iommu/arm-smmu: Add a init_context_bank implementation hook

2020-08-10 Thread Jordan Crouse
Add a new implementation hook to allow the implementation specific code to tweek the context bank configuration just before it gets written. The first user will be the Adreno GPU implementation to turn on SCTLR.HUPCF to ensure that a page fault doesn't terminating pending transactions. Doing so cou

[PATCH v12 03/13] iommu/arm-smmu: Prepare for the adreno-smmu implementation

2020-08-10 Thread Jordan Crouse
Do a bit of prep work to add the upcoming adreno-smmu implementation. Add an hook to allow the implementation to choose which context banks to allocate. Then, add domain_attr_get / domain_attr_set hooks to allow for implementation specific domain attributes. Move some of the common structs to arm

[PATCH v12 00/13] iommu/arm-smmu: Add Adreno SMMU specific implementation

2020-08-10 Thread Jordan Crouse
This series adds an Adreno SMMU implementation to arm-smmu to allow GPU hardware pagetable switching. The Adreno GPU has built in capabilities to switch the TTBR0 pagetable during runtime to allow each individual instance or application to have its own pagetable. In order to take advantage of the

[PATCH v12 07/13] drm/msm: Add a context pointer to the submitqueue

2020-08-10 Thread Jordan Crouse
Each submitqueue is attached to a context. Add a pointer to the context to the submitqueue at create time and refcount it so that it stays around through the life of the queue. GPU submissions can access the active context via the submitqueue instead of requiring it to be passed around from functi

[PATCH v12 12/13] arm: dts: qcom: sm845: Set the compatible string for the GPU SMMU

2020-08-10 Thread Jordan Crouse
Set the qcom,adreno-smmu compatible string for the GPU SMMU to enable split pagetables and per-instance pagetables for drm/msm. Signed-off-by: Jordan Crouse --- arch/arm64/boot/dts/qcom/sdm845.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/qcom/sdm8

[PATCH v12 02/13] iommu/arm-smmu: Add support for split pagetables

2020-08-10 Thread Jordan Crouse
Enable TTBR1 for a context bank if IO_PGTABLE_QUIRK_ARM_TTBR1 is selected by the io-pgtable configuration. Signed-off-by: Jordan Crouse --- drivers/iommu/arm/arm-smmu/arm-smmu.c | 21 - drivers/iommu/arm/arm-smmu/arm-smmu.h | 25 +++-- 2 files changed, 35

[PATCH v12 04/13] iommu: Add a domain attribute to get/set a pagetable configuration

2020-08-10 Thread Jordan Crouse
Add domain attribute DOMAIN_ATTR_PGTABLE_CFG. This will be used by arm-smmu to share the current pagetable configuration with the leaf driver and to allow the leaf driver to set up a new pagetable configuration under certain circumstances. Signed-off-by: Jordan Crouse --- include/linux/iommu.h

[RFC V2 PATCH] dma-iommu: allow devices to set IOVA range dynamically

2020-08-10 Thread Ajay Kumar
Currently, there is no other option to change the lower limit of IOVA for any device than calling iova_init_domain(), but the said function will re-init whole domain and also doesn't track the previously allocated IOVA before re-initing the domain. There are cases where the device might not suppor

Re: [RFC V2 PATCH] dma-iommu: allow devices to set IOVA range dynamically

2020-08-10 Thread Christoph Hellwig
On Mon, Aug 10, 2020 at 11:28:12PM +0530, Ajay Kumar wrote: > Currently, there is no other option to change the lower limit of > IOVA for any device than calling iova_init_domain(), but the > said function will re-init whole domain and also doesn't track > the previously allocated IOVA before re-in