[PATCH v19 0/4] iommu/arm-smmu: Add adreno-smmu implementation and bindings

2020-11-09 Thread Jordan Crouse
/git/will/linux.git for-joerg/arm-smmu/updates to pick up system cache patches and devm_realloc() updates. Use a function hook to modify / write sctlr v18: No deltas in this patchset since the last go-around for 5.10 [1]. [1] https://patchwork.freedesktop.org/series/81393/ Jordan Crouse

[PATCH v19 4/4] arm: dts: qcom: sm845: Set the compatible string for the GPU SMMU

2020-11-09 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 Signed-off-by: Rob Clark Reviewed-by: Bjorn Andersson --- arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi | 9 + arch/arm64/boot/dts

[PATCH v19 1/4] iommu/arm-smmu-qcom: Add implementation for the adreno GPU SMMU

2020-11-09 Thread Jordan Crouse
hardware can implement per-instance pagetables. Co-developed-by: Rob Clark Signed-off-by: Jordan Crouse Signed-off-by: Rob Clark Reviewed-by: Bjorn Andersson --- drivers/iommu/arm/arm-smmu/arm-smmu-impl.c | 3 + drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 151 - drivers

[PATCH v19 2/4] iommu/arm-smmu: Add a way for implementations to influence SCTLR

2020-11-09 Thread Jordan Crouse
ue if it wishes. Co-developed-by: Jordan Crouse Signed-off-by: Rob Clark Signed-off-by: Jordan Crouse --- drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 13 + drivers/iommu/arm/arm-smmu/arm-smmu.c | 5 - drivers/iommu/arm/arm-smmu/arm-smmu.h | 2 ++ 3 files change

[PATCH v19 3/4] dt-bindings: arm-smmu: Add compatible string for Adreno GPU SMMU

2020-11-09 Thread Jordan Crouse
. Signed-off-by: Jordan Crouse Reviewed-by: Rob Herring Signed-off-by: Rob Clark Reviewed-by: Bjorn Andersson --- Documentation/devicetree/bindings/iommu/arm,smmu.yaml | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/iommu/arm

[RFC PATCH v1 1/3] iommu/arm-smmu: Add support for driver IOMMU fault handlers

2020-11-09 Thread Jordan Crouse
Call report_iommu_fault() to allow upper-level drivers to register their own fault handlers. Signed-off-by: Jordan Crouse --- drivers/iommu/arm/arm-smmu/arm-smmu.c | 16 +--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.c b

[RFC PATCH v1 3/3] drm/msm: Improve the a6xx page fault handler

2020-11-09 Thread Jordan Crouse
Use the new adreno-smmu-priv fault info function to get more SMMU debug registers and print the current TTBR0 to debug per-instance pagetables and figure out which GPU block generated the request. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 4 +- drivers/gpu/drm

[RFC PATCH v1 0/3] iommu/arm-smmu: adreno-smmu page fault handling

2020-11-09 Thread Jordan Crouse
later for even more extensive GPU side page fault debugging capabilities. Jordan Crouse (3): iommu/arm-smmu: Add support for driver IOMMU fault handlers drm/msm: Add an adreno-smmu-priv callback to get pagefault info drm/msm: Improve the a6xx page fault handler drivers/gpu/drm/msm/adreno

[RFC PATCH v1 2/3] drm/msm: Add an adreno-smmu-priv callback to get pagefault info

2020-11-09 Thread Jordan Crouse
Add a callback in adreno-smmu-priv to read interesting SMMU registers to provide an opportunity for a richer debug experience in the GPU driver. Signed-off-by: Jordan Crouse --- drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 19 + drivers/iommu/arm/arm-smmu/arm-smmu.h | 2

[PATCH v2 2/3] drm/msm: Add an adreno-smmu-priv callback to get pagefault info

2020-11-24 Thread Jordan Crouse
Add a callback in adreno-smmu-priv to read interesting SMMU registers to provide an opportunity for a richer debug experience in the GPU driver. Signed-off-by: Jordan Crouse --- drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 19 + drivers/iommu/arm/arm-smmu/arm-smmu.h | 2

[PATCH v2 0/3] iommu/arm-smmu: adreno-smmu page fault handling

2020-11-24 Thread Jordan Crouse
later for even more extensive GPU side page fault debugging capabilities. v2: Fix comment wording and function pointer check per Rob Clark Jordan Crouse (3): iommu/arm-smmu: Add support for driver IOMMU fault handlers drm/msm: Add an adreno-smmu-priv callback to get pagefault info drm/msm

[PATCH v2 1/3] iommu/arm-smmu: Add support for driver IOMMU fault handlers

2020-11-24 Thread Jordan Crouse
Call report_iommu_fault() to allow upper-level drivers to register their own fault handlers. Signed-off-by: Jordan Crouse --- drivers/iommu/arm/arm-smmu/arm-smmu.c | 16 +--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.c b

[PATCH v2 3/3] drm/msm: Improve the a6xx page fault handler

2020-11-24 Thread Jordan Crouse
Use the new adreno-smmu-priv fault info function to get more SMMU debug registers and print the current TTBR0 to debug per-instance pagetables and figure out which GPU block generated the request. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 4 +- drivers/gpu/drm

Re: [PATCH] iommu/io-pgtable: Remove tlb_flush_leaf

2020-11-25 Thread Jordan Crouse
On Wed, Nov 25, 2020 at 06:24:13PM +, Robin Murphy wrote: > On 2020-11-25 17:29, Robin Murphy wrote: > >The only user of tlb_flush_leaf is a particularly hairy corner of the > >Arm short-descriptor code, which wants a synchronous invalidation to > >minimise the races inherent in trying to split

Re: [PATCH v2 1/3] iommu/arm-smmu: Add support for driver IOMMU fault handlers

2021-01-25 Thread Jordan Crouse
On Fri, Jan 22, 2021 at 12:53:17PM +, Robin Murphy wrote: > On 2021-01-22 12:41, Will Deacon wrote: > >On Tue, Nov 24, 2020 at 12:15:58PM -0700, Jordan Crouse wrote: > >>Call report_iommu_fault() to allow upper-level drivers to register their > >>own fault handl

Re: [PATCH v2 1/5] drm/nouveau: tegra: Detach from ARM DMA/IOMMU mapping

2018-04-25 Thread Jordan Crouse
On Wed, Apr 25, 2018 at 12:10:47PM +0200, Thierry Reding wrote: > From: Thierry Reding > > Depending on the kernel configuration, early ARM architecture setup code > may have attached the GPU to a DMA/IOMMU mapping that transparently uses > the IOMMU to back the DMA API. Tegra requires special ha

[PATCH 01/16] iommu: Add DOMAIN_ATTR_SPLIT_TABLES

2018-05-18 Thread Jordan Crouse
Add a new domain attribute to enable split pagetable support for devices devices that support it. Signed-off-by: Jordan Crouse --- include/linux/iommu.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/iommu.h b/include/linux/iommu.h index d7e2f54086e4..366254e4b07f 100644

[RFC v2 00/16] Private PASID and per-instance pagetables

2018-05-18 Thread Jordan Crouse
hanges from v1]: * Switch the domain attribute to SPLIT_TABLES (Robin Murphy) * Reuse existing mm hooks as much as possible (Jean Phillipe Brucker) * Consolidate iommu map/unmap code (Jean Phillipe Brucker) [1] https://patchwork.kernel.org/patch/10394883/ Jordan Crouse (16): iommu: Add DOMAIN_ATTR

[PATCH 02/16] iommu/arm-smmu: Add split pagetable support for arm-smmu-v2

2018-05-18 Thread Jordan Crouse
Add support for a split pagetable (TTBR0/TTBR1) scheme for arm-smmu-v2. If split pagetables are enabled, create a pagetable for TTBR1 and set up the sign extension bit so that all IOVAs with that bit set are mapped and translated from the TTBR1 pagetable. Signed-off-by: Jordan Crouse

[PATCH 03/16] iommu/io-pgtable-arm: Remove ttbr[1] from io_pgtbl_cfg

2018-05-18 Thread Jordan Crouse
Now that we have a working example of an ARM driver that implements split pagetables completely in the client driver it is apparent that we don't need to store an extra ttbr value in the io_pgtbl_cfg struct that will never get used. Signed-off-by: Jordan Crouse --- drivers/iommu/arm-sm

[PATCH 05/16] iommu: arm-smmu: Add support for private PASIDs

2018-05-18 Thread Jordan Crouse
Add support for allocating and populating pagetables indexed by private PASIDs. Each new PASID is allocated a pagetable with the same parameters and format as the parent domain. Signed-off-by: Jordan Crouse --- drivers/iommu/arm-smmu.c | 154 +++-- drivers

[PATCH 04/16] iommu: sva: Add support for private PASIDs

2018-05-18 Thread Jordan Crouse
PASIDs by creating a new io-pgtable instance map it to a PASID and provide the APIs for drivers to populate it manually. Signed-off-by: Jordan Crouse --- drivers/iommu/iommu-sva.c | 139 -- drivers/iommu/iommu.c | 66 +- include/linux/iommu.h

[PATCH 06/16] iommu: arm-smmu: Add side-band function for specific PASID callbacks

2018-05-18 Thread Jordan Crouse
e relevant pagetable information to the client driver whenever a new PASID is created or destroyed Signed-off-by: Jordan Crouse --- drivers/iommu/arm-smmu.c | 40 include/linux/arm-smmu.h | 18 ++ 2 files changed, 58 insertions(+) create m

[PATCH 07/16] drm/msm/gpu: Enable 64 bit mode by default

2018-05-18 Thread Jordan Crouse
addresses so switch over now to prepare for using addresses above 4G for targets that support them. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 14 ++ drivers/gpu/drm/msm/msm_iommu.c | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff

[PATCH 10/16] drm/msm: Add msm_mmu features

2018-05-18 Thread Jordan Crouse
Add a few simple support functions to support a bitmask of features that a specific MMU implementation supports. The first feature will be per-instance pagetables coming in the following patch. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/msm_mmu.h | 13 + 1 file changed, 13

[PATCH 09/16] drm/msm/gpu: Support using split page tables for kernel buffer objects

2018-05-18 Thread Jordan Crouse
ll need additional support to be enabled but even if they aren't set up it isn't harmful to just use TTBR1 for all virtual memory regions and leave the other pagetable unused. If TTBR1 support isn't enabled then fall back to the "legacy" virtual address space both kernel

[PATCH 12/16] drm/msm: Add support for per-instance address spaces

2018-05-18 Thread Jordan Crouse
Add a function to allocate a new pasid from a existing MMU domain and create a per-instance address space. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/msm_drv.h | 3 +++ drivers/gpu/drm/msm/msm_gem_vma.c | 37 +-- 2 files changed, 33 insertions(+), 7

[PATCH 11/16] drm/msm: Add support for iommu-sva PASIDs

2018-05-18 Thread Jordan Crouse
msm_mmu struct to abstract (most) of the details from the rest of the system. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/msm_iommu.c | 190 drivers/gpu/drm/msm/msm_mmu.h | 6 + 2 files changed, 196 insertions(+) diff --git a/drivers/gpu/drm/msm

[PATCH 08/16] drm/msm: Pass the MMU domain index in struct msm_file_private

2018-05-18 Thread Jordan Crouse
Pass the index of the MMU domain in struct msm_file_private instead of assuming gpu->id throughout the submit path. This clears the way to change ctx->aspace to a per-instance pagetable. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/msm_drv.c| 16 drivers/g

[PATCH 15/16] iommu: Gracefully allow drivers to not attach to a default domain

2018-05-18 Thread Jordan Crouse
APIs to work and the next domain to try to attach will take group->domain for itself and everything will proceed as normal. Signed-off-by: Jordan Crouse --- drivers/iommu/iommu.c | 17 + 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/drivers/iommu/iommu.c

[PATCH 14/16] drm/msm: Support per-instance address spaces

2018-05-18 Thread Jordan Crouse
Create a per-instance address spaces when a new DRM file instance is opened assuming the target supports it and the underlying infrastructure exists. If the operation is unsupported fall back quietly to use the global pagetable. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/msm_drv.c

[PATCH 13/16] drm/msm/a5xx: Support per-instance pagetables

2018-05-18 Thread Jordan Crouse
. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/Kconfig | 1 + drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 55 + drivers/gpu/drm/msm/adreno/a5xx_gpu.h | 17 ++ drivers/gpu/drm/msm/adreno/a5xx_preempt.c | 74 +++ drivers/gpu/drm/msm

[PATCH 16/16] iommu/arm-smmu: Add list of devices to opt out of DMA domains

2018-05-18 Thread Jordan Crouse
DMA ops. Later the client device in question can set up and attach their own domain. Signed-off-by: Jordan Crouse --- drivers/iommu/arm-smmu.c | 24 1 file changed, 24 insertions(+) diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index 100797a07be0

Re: [PATCH 1/1] iommu/arm-smmu: Add support to use Last level cache

2018-06-15 Thread Jordan Crouse
On Fri, Jun 15, 2018 at 05:52:32PM +0100, Will Deacon wrote: > Hi Vivek, > > On Fri, Jun 15, 2018 at 04:23:29PM +0530, Vivek Gautam wrote: > > Qualcomm SoCs have an additional level of cache called as > > System cache or Last level cache[1]. This cache sits right > > before the DDR, and is tightly

Re: [PATCH 04/16] iommu: sva: Add support for private PASIDs

2018-07-17 Thread Jordan Crouse
On Tue, Jul 17, 2018 at 12:21:03PM +0100, Jean-Philippe Brucker wrote: > Hi Jordan, > > Thanks for the patches, I finally got around testing them with SMMUv3. > It's an important feature, arguably more than SVA itself. I could pick > this one as part of the SVA series, what do you think? I'm good

Re: [RFC PATCH v1 0/6] Resolve unwanted DMA backing with IOMMU

2018-07-27 Thread Jordan Crouse
On Fri, Jul 27, 2018 at 05:02:37PM +0100, Robin Murphy wrote: > On 27/07/18 15:10, Dmitry Osipenko wrote: > >On Friday, 27 July 2018 12:03:28 MSK Will Deacon wrote: > >>On Fri, Jul 27, 2018 at 10:25:13AM +0200, Joerg Roedel wrote: > >>>On Fri, Jul 27, 2018 at 02:16:18AM +0300, Dmitry Osipenko wrote

Re: [RFC PATCH v1 0/6] Resolve unwanted DMA backing with IOMMU

2018-08-03 Thread Jordan Crouse
On Fri, Aug 03, 2018 at 04:43:41PM +0100, Robin Murphy wrote: > On 02/08/18 19:24, Dmitry Osipenko wrote: > >On Friday, 27 July 2018 20:16:53 MSK Dmitry Osipenko wrote: > >>On Friday, 27 July 2018 20:03:26 MSK Jordan Crouse wrote: > >>>On Fri, Jul 27, 2018 at 05:02:

Re: [PATCH 1/1] iommu/arm-smmu: Add support to use Last level cache

2018-09-19 Thread Jordan Crouse
On Tue, Jul 24, 2018 at 03:13:37PM +0530, Vivek Gautam wrote: > Hi Will, > > > On Wed, Jun 27, 2018 at 10:07 PM, Will Deacon wrote: > > Hi Vivek, > > > > On Tue, Jun 19, 2018 at 02:04:44PM +0530, Vivek Gautam wrote: > >> On Fri, Jun 15, 2018 at 10:22 PM, Will Deacon wrote: > >> > On Fri, Jun 15

<    1   2   3   4