Re: [PATCH 3/4] iommu/arm-smmu: Disable stalling faults for all endpoints

2016-12-06 Thread Jordan Crouse
On Tue, Dec 06, 2016 at 06:30:21PM -0500, Rob Clark wrote: > On Thu, Aug 18, 2016 at 9:05 AM, Will Deacon wrote: > > Enabling stalling faults can result in hardware deadlock on poorly > > designed systems, particularly those with a PCI root complex upstream of > > the SMMU. > > > > Although it's n

Re: [RFC 2/3] iommu/arm-smmu: Add qcom implementation

2017-01-03 Thread Jordan Crouse
On Tue, Jan 03, 2017 at 04:30:55PM -0500, Rob Clark wrote: > At least on the db820c I have, with the firmware I have, I'm not seeing > the SS bit set, even though the iommu is in a stalled state. So for > this implementation ignore not having SS bit set. The SS bit gets set if SCTLR.CFCFG is set

[PATCH 4/7] iommu: introduce TTBR0 domain attribute

2017-03-07 Thread Jordan Crouse
before TTBR0 may be queried. Signed-off-by: Jeremy Gebben 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 d537cc9..544cfc6 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h

[PATCH 2/7] iommu: Add DOMAIN_ATTR_ENABLE_TTBR1

2017-03-07 Thread Jordan Crouse
fely. 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 436dc21..d537cc9 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -114,6 +114,7 @@ enum iommu_attr { DOMAIN_

[PATCH 1/7] iommu/arm-smmu: save the pgtbl_cfg in the domain

2017-03-07 Thread Jordan Crouse
From: Mitchel Humpherys The pgtbl_cfg object has a few handy properties that we'd like to make use of later (returning the pgd in a domain attribute, for example). Keep track of the domain pgtbl_cfg in the domain structure. Signed-off-by: Mitchel Humpherys --- drivers/iommu/arm-smmu.c | 11 +++

[PATCH 0/7] RFC: iommu/arm-smmu-v2: Dynamic domains

2017-03-07 Thread Jordan Crouse
along. Thanks! Jordan Jeremy Gebben (2): iommu: introduce TTBR0 domain attribute iommu/arm-smmu: add support for TTBR0 attribute Jordan Crouse (4): iommu: Add DOMAIN_ATTR_ENABLE_TTBR1 iommu/arm-smmu: Add support for TTBR1 iommu: Add dynamic domains iommu/arm-smmu: add support for dynamic dom

[PATCH 5/7] iommu/arm-smmu: add support for TTBR0 attribute

2017-03-07 Thread Jordan Crouse
From: Jeremy Gebben Add support to return the value of the TTBR0 register in response to a request via DOMAIN_ATTR_TTBR0. Signed-off-by: Jeremy Gebben Signed-off-by: Jordan Crouse --- drivers/iommu/arm-smmu.c | 13 + 1 file changed, 13 insertions(+) diff --git a/drivers/iommu

[PATCH 3/7] iommu/arm-smmu: Add support for TTBR1

2017-03-07 Thread Jordan Crouse
/unmap operations will automatically use the appropriate pagetable based on the specified iova and the existing mask. Signed-off-by: Jordan Crouse --- drivers/iommu/arm-smmu.c | 19 - drivers/iommu/io-pgtable-arm.c | 168 + drivers/iommu/io

[PATCH 6/7] iommu: Add dynamic domains

2017-03-07 Thread Jordan Crouse
-dynamic domains. The domains will share configuration (pagetable format, context bank, etc). Dynamic domains do not modify the hardware directly - they are typically a wrapper for the pagetable memory and facilitate using the other IOMMU APIs to map and unmap buffers. Signed-off-by: Jordan Crouse

[PATCH 7/7] iommu/arm-smmu: add support for dynamic domains

2017-03-07 Thread Jordan Crouse
is restored at the end of the switch operation. Signed-off-by: Jeremy Gebben Signed-off-by: Jordan Crouse --- drivers/iommu/arm-smmu.c | 157 --- 1 file changed, 136 insertions(+), 21 deletions(-) diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/a

Re: [Freedreno] [PATCH 0/7] RFC: iommu/arm-smmu-v2: Dynamic domains

2017-03-07 Thread Jordan Crouse
On Tue, Mar 07, 2017 at 09:39:48AM -0700, Jordan Crouse wrote: > Pursuant to the arm-smmu-v3 SVM support: > > https://lists.linuxfoundation.org/pipermail/iommu/2017-February/020599.html > > I felt it would be helpful if I would demonstrate how Qualcomm implements > per-proc

Re: [PATCH 7/7] iommu/arm-smmu: add support for dynamic domains

2017-03-07 Thread Jordan Crouse
On Tue, Mar 07, 2017 at 06:11:38PM +, Mark Rutland wrote: > On Tue, Mar 07, 2017 at 09:39:55AM -0700, Jordan Crouse wrote: > > Implement support for dynamic domain switching. This feature is > > only enabled when the qcom,dynamic device tree attribute for an smmu > >

Re: [PATCH v2 1/4] iommu/arm-smmu: Simplify ASID/VMID handling

2017-03-30 Thread Jordan Crouse
M, so it's no bad thing. If it helps: Reviewed-by: Jordan Crouse > Signed-off-by: Robin Murphy > --- > > v2: No change > > drivers/iommu/arm-smmu.c | 36 +++- > 1 file changed, 19 insertions(+), 17 deletions(-) > > diff --git a/dri

Re: [PATCH v2 2/4] iommu/arm-smmu: Tidy up context bank indexing

2017-03-30 Thread Jordan Crouse
and every other usage is to dynamically calculate CB_BASE over > and over and over again. Let's flip things around so that we just > maintain the CB_BASE address directly. Reviewed-by: Jordan Crouse > Signed-off-by: Robin Murphy > --- > > v2: No change > > drivers/iommu

Re: [PATCH v2 4/4] iommu/arm-smmu: Poll for TLB sync completion more effectively

2017-03-30 Thread Jordan Crouse
one or two "reasonable time" > periods, it becomes increasingly unlikely that it ever will. I really really like this. Reviewed-by: Jordan Crouse > Signed-off-by: Robin Murphy > --- > > v2: Restored the cpu_relax() to the inner loop > > drivers/iommu/arm-smmu.c | 18

Re: [PATCH V3 0/5] iommu/arm-smmu: Add runtime pm/sleep support

2017-04-07 Thread Jordan Crouse
On Tue, Apr 04, 2017 at 12:39:14PM -0700, Stephen Boyd wrote: > On 04/03, Will Deacon wrote: > > On Fri, Mar 31, 2017 at 10:58:16PM -0400, Rob Clark wrote: > > > On Fri, Mar 31, 2017 at 1:54 PM, Will Deacon wrote: > > > > On Thu, Mar 09, 2017 at 09:05:43PM +0530, Sricharan R wrote: > > > >> This s

Re: [RFC PATCH v3 10/10] iommu/sva: Add support for private PASIDs

2018-10-12 Thread Jordan Crouse
be bound to > multiple devices. The mm_alloc() IOMMU op must now check if the mm > argument is NULL, in which case it should allocate io_pgtables instead of > binding to an mm. > > Signed-off-by: Jordan Crouse > Signed-off-by: Jean-Philippe Brucker > --- > Sadly this proba

Re: [RFC PATCH v3 10/10] iommu/sva: Add support for private PASIDs

2018-10-17 Thread Jordan Crouse
On Wed, Oct 17, 2018 at 03:21:43PM +0100, Jean-Philippe Brucker wrote: > Hi Jordan, > > On 12/10/2018 15:32, Jordan Crouse wrote: > > On Thu, Sep 20, 2018 at 06:00:46PM +0100, Jean-Philippe Brucker wrote: > >> Provide an API for allocating PASIDs and populating them manual

Re: [RFC PATCH 0/6] Auxiliary IOMMU domains and Arm SMMUv3

2018-10-22 Thread Jordan Crouse
On Mon, Oct 22, 2018 at 12:50:56PM +0100, Robin Murphy wrote: > On 22/10/2018 07:53, Tian, Kevin wrote: > >>From: Jean-Philippe Brucker [mailto:jean-philippe.bruc...@arm.com] > >>Sent: Saturday, October 20, 2018 2:12 AM > >> > >>This is a first prototype adding auxiliary domain support to Arm SMMUv

Re: [RFC PATCH 0/6] Auxiliary IOMMU domains and Arm SMMUv3

2018-10-22 Thread Jordan Crouse
On Fri, Oct 19, 2018 at 07:11:52PM +0100, Jean-Philippe Brucker wrote: > (2) Allocate a domain and attach it to the device. > > dom = iommu_domain_alloc() > iommu_attach_device(dom, dev) > > I still have concerns about this part, which are highlighted by the > messy changes o

Re: [PATCH] iommu: arm-smmu: Set SCTLR.HUPCF bit

2018-11-26 Thread Jordan Crouse
On Mon, Nov 26, 2018 at 07:31:48PM +, Will Deacon wrote: > Hi Rob, > > On Tue, Nov 13, 2018 at 08:12:35AM -0500, Rob Clark wrote: > > On Tue, Nov 13, 2018 at 1:32 AM Will Deacon wrote: > > > On Fri, Nov 09, 2018 at 01:01:55PM -0500, Rob Clark wrote: > > > > On Mon, Oct 29, 2018 at 3:09 PM Wil

[RFC PATCH v1 00/15] drm/msm: Per-instance pagetable support

2019-03-01 Thread Jordan Crouse
cular, I want to make sure that this fits with the current thinking about how aux domains should look and feel. [1] https://patchwork.freedesktop.org/series/43447/ [2] https://patchwork.kernel.org/patch/10825061/ Jordan Crouse (15): iommu: Add DOMAIN_ATTR_SPLIT_TABLES iommu/arm-smmu: Add

[RFC PATCH v1 01/15] iommu: Add DOMAIN_ATTR_SPLIT_TABLES

2019-03-01 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 e90da6b..3f2250b 100644 --- a/include

[RFC PATCH v1 05/15] iommu/arm-smmu: Add auxiliary domain support for arm-smmuv2

2019-03-01 Thread Jordan Crouse
u domain to map and unmap iova addresses in the pagetable. The driver/hardware can be used to switch the pagetable according to its own specific implementation. Signed-off-by: Jordan Crouse --- drivers/iommu/arm-smmu.c | 135 ++- 1 file changed, 11

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

2019-03-01 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

[RFC PATCH v1 03/15] iommu/io-pgtable: Allow TLB operations to be optional

2019-03-01 Thread Jordan Crouse
configuration to be NULL just in case the caller accidentally calls for a flush with the wrong device. Signed-off-by: Jordan Crouse --- drivers/iommu/io-pgtable.h | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/io-pgtable.h b/drivers/iommu/io-pgtable.h

[RFC PATCH v1 04/15] iommu: Add DOMAIN_ATTR_PTBASE

2019-03-01 Thread Jordan Crouse
Add an attribute to return the base address of the pagetable. This is used by auxiliary domains from arm-smmu to return the address of the pagetable to the leaf driver so that it can set the appropriate pagetable through it's own means. Signed-off-by: Jordan Crouse --- include/linux/io

Re: [RFC PATCH v1 04/15] iommu: Add DOMAIN_ATTR_PTBASE

2019-03-18 Thread Jordan Crouse
On Mon, Mar 18, 2019 at 10:53:21AM +0100, Joerg Roedel wrote: > On Fri, Mar 01, 2019 at 12:38:26PM -0700, Jordan Crouse wrote: > > Add an attribute to return the base address of the pagetable. This is used > > by auxiliary domains from arm-smmu to return the address of the paget

Re: [RFC PATCH v1] iommu/arm-smmu: Allow domains to choose a context bank

2020-02-18 Thread Jordan Crouse
On Tue, Feb 18, 2020 at 10:19:53AM -0800, Rob Clark wrote: > On Tue, Jan 28, 2020 at 2:34 PM Jordan Crouse wrote: > > > > Domains which are being set up for split pagetables usually want to be > > on a specific context bank for hardware reasons. Force the context > >

Re: [Freedreno] [PATCH v5 0/5] iommu/arm-smmu: Split pagetable support for arm-smmu-v2

2020-02-27 Thread Jordan Crouse
On Tue, Jan 28, 2020 at 03:00:14PM -0700, Jordan Crouse wrote: > This is another iteration for the split pagetable support based on the > suggestions from Robin and Will [1]. > > Background: In order to support per-context pagetables the GPU needs to enable > split tables so th

Re: [PATCH v1 2/6] arm/smmu: Add auxiliary domain support for arm-smmuv2

2020-03-19 Thread Jordan Crouse
On Wed, Mar 18, 2020 at 04:43:07PM -0700, Rob Clark wrote: > On Wed, Mar 18, 2020 at 3:48 PM Will Deacon wrote: > > > > On Tue, Jan 28, 2020 at 03:16:06PM -0700, Jordan Crouse wrote: > > > Support auxiliary domains for arm-smmu-v2 to initialize and support > > >

[PATCH v6 1/5] iommu: Add DOMAIN_ATTR_SPLIT_TABLES

2020-04-09 Thread Jordan Crouse
Add a new attribute to enable and query the state of split pagetables for the domain. Acked-by: Will Deacon Signed-off-by: Jordan Crouse --- include/linux/iommu.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 7ef8b0bda695

[PATCH v6 4/5] drm/msm: Refactor address space initialization

2020-04-09 Thread Jordan Crouse
functions to create the address space so a2xx can do its own thing in its own space. For all the other targets use a generic helper to initialize IOMMU but leave the door open for newer targets to use customization if they need it. Reviewed-by: Rob Clark Signed-off-by: Jordan Crouse --- drivers/gpu

[PATCH v6 3/5] drm/msm: Attach the IOMMU device during initialization

2020-04-09 Thread Jordan Crouse
aggressive cleanups that follow. Reviewed-by: Rob Clark Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 8 drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c | 4 drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c | 7 --- drivers/gpu/drm/msm/msm_gem_vma.c

[PATCH v6 2/5] iommu/arm-smmu: Add support for TTBR1

2020-04-09 Thread Jordan Crouse
value of he domain attribute can be queried to see if the split pagetables were successfully programmed. The domain geometry will be updated as well so that the caller can determine the active region for the pagetable that was programmed. Signed-off-by: Jordan Crouse --- drivers/iommu/arm-smmu.c

[PATCH v6 0/5] iommu/arm-smmu: Split pagetable support for arm-smmu-v2

2020-04-09 Thread Jordan Crouse
will be enabled later when an auxiliary domain is attached v3: Remove the implementation specific and make split pagetable support part of the generic configuration [1] https://lists.linuxfoundation.org/pipermail/iommu/2020-January/041373.html Jordan Crouse (5): iommu: Add

[PATCH v6 5/5] drm/msm/a6xx: Support split pagetables

2020-04-09 Thread Jordan Crouse
start swapping TTBR0 for context-specific pagetables. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 52 ++- 1 file changed, 51 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno

Re: [PATCH 0/2] iommu/arm-smmu: Allow client devices to select direct mapping

2020-04-13 Thread Jordan Crouse
t identity > > > mapping using iommu_request_dm_for_dev(). First patch is > > > a cleanup to support other SoCs to call into QCOM specific > > > implementation and preparation for second patch. > > > Second patch sets the default identity domain for drm devices. &g

Re: [PATCH] iomm/arm-smmu: Add stall implementation hook

2020-05-11 Thread Jordan Crouse
On Fri, May 08, 2020 at 08:40:40AM -0700, Rob Clark wrote: > On Fri, May 8, 2020 at 8:32 AM Rob Clark wrote: > > > > On Thu, May 7, 2020 at 5:54 AM Will Deacon wrote: > > > > > > On Thu, May 07, 2020 at 11:55:54AM +0100, Robin Murphy wrote: > > > > On 2020-05-07 11:14 am, Sai Prakash Ranjan wrote

Re: [PATCH v6 2/5] iommu/arm-smmu: Add support for TTBR1

2020-05-19 Thread Jordan Crouse
On Mon, May 18, 2020 at 03:59:59PM +0100, Will Deacon wrote: > On Thu, Apr 09, 2020 at 05:33:47PM -0600, Jordan Crouse wrote: > > Add support to enable TTBR1 if the domain requests it via the > > DOMAIN_ATTR_SPLIT_TABLES attribute. If enabled by the hardware > > and pageta

Re: [PATCH v1 2/6] arm/smmu: Add auxiliary domain support for arm-smmuv2

2020-05-20 Thread Jordan Crouse
On Wed, May 20, 2020 at 01:57:01PM +0100, Will Deacon wrote: > On Mon, May 18, 2020 at 08:50:27AM -0700, Rob Clark wrote: > > On Mon, May 18, 2020 at 8:18 AM Will Deacon wrote: > > > On Wed, Mar 18, 2020 at 04:43:07PM -0700, Rob Clark wrote: > > > > We do in fact need live domain switching, that i

[PATCH] iommu/arm-smmu: Mark qcom_smmu_client_of_match as possibly unused

2020-06-03 Thread Jordan Crouse
by: kbuild test robot Signed-off-by: Jordan Crouse --- drivers/iommu/arm-smmu-qcom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/arm-smmu-qcom.c b/drivers/iommu/arm-smmu-qcom.c index cf01d0215a39..063b4388b0ff 100644 --- a/drivers/iommu/arm-smmu-qcom.c +++

[PATCH v2] iommu/arm-smmu: Mark qcom_smmu_client_of_match as possibly unused

2020-06-04 Thread Jordan Crouse
by: kbuild test robot Acked-by: Will Deacon Signed-off-by: Jordan Crouse --- drivers/iommu/arm-smmu-qcom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/arm-smmu-qcom.c b/drivers/iommu/arm-smmu-qcom.c index cf01d0215a39..be4318044f96 100644 --- a/drivers/iomm

[PATCH v7 2/6] iommu/arm-smmu: Add support for split pagetables

2020-06-04 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-smmu.c | 21 - drivers/iommu/arm-smmu.h | 25 +++-- 2 files changed, 35 insertions(+), 11

[PATCH v7 0/6] iommu/arm-smmu: Enable split pagetable support

2020-06-04 Thread Jordan Crouse
dware would be less confusing when debugging a hang. [1] https://lists.linuxfoundation.org/pipermail/iommu/2020-May/044537.html [2] https://patchwork.kernel.org/patch/11482591/ Jordan Crouse (6): iommu/arm-smmu: Pass io-pgtable config to implementation specific function iommu/arm-smmu

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

2020-06-04 Thread Jordan Crouse
. Signed-off-by: Jordan Crouse --- Documentation/devicetree/bindings/iommu/arm,smmu.yaml | 4 1 file changed, 4 insertions(+) diff --git a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml index d7ceb4c34423..e52a1b146c97 100644

[PATCH v7 1/6] iommu/arm-smmu: Pass io-pgtable config to implementation specific function

2020-06-04 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-smmu-impl.c | 3 ++- drivers

[PATCH v7 4/6] iommu/arm-smmu: Add implementation for the adreno GPU SMMU

2020-06-04 Thread Jordan Crouse
Add a special implementation for the SMMU attached to most Adreno GPU target triggered from the qcom,adreno-gpu-smmu compatible string. When selected the driver will attempt to enable split pagetables. Signed-off-by: Jordan Crouse --- drivers/iommu/arm-smmu-impl.c | 5 - drivers/iommu/arm

[PATCH] iommu/arm-smmu: Don't bypass pinned stream mappings

2020-06-09 Thread Jordan Crouse
ader") [1] that identifies streams that are already configured and marked them as pinned. This patch extends that to not re-write pinned stream mappings for ARM_SMMU_DOMAIN_BYPASS domains. [1] https://lore.kernel.org/r/20191226221709.3844244-4-bjorn.anders...@linaro.org Signed-o

[PATCH v8 6/7] drm/msm: Set the global virtual address range from the IOMMU domain

2020-06-11 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

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

2020-06-11 Thread Jordan Crouse
Set the qcom,adreno-smmu compatible string for the GPU SMMU to enable split pagetables. 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/sdm845.dtsi b/arch/arm64/boot/dts/qcom

[PATCH v8 4/7] iommu/arm-smmu: Add a pointer to the attached device to smmu_domain

2020-06-11 Thread Jordan Crouse
Add a link to the pointer to the struct device that is attached to a domain. This makes it easy to get the pointer if it is needed in the implementation specific code. Signed-off-by: Jordan Crouse --- drivers/iommu/arm-smmu.c | 1 + drivers/iommu/arm-smmu.h | 1 + 2 files changed, 2 insertions

[PATCH v8 0/7] iommu/arm-smmu: Enable split pagetable support

2020-06-11 Thread Jordan Crouse
g the hardware would be less confusing when debugging a hang. v8: Pass the attached device in the smmu_domain to the implementation specific functions [1] https://lists.linuxfoundation.org/pipermail/iommu/2020-May/044537.html [2] https://patchwork.kernel.org/patch/11482591/ Jordan Crouse (7): iomm

[PATCH v8 2/7] iommu/arm-smmu: Add support for split pagetables

2020-06-11 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-smmu.c | 21 - drivers/iommu/arm-smmu.h | 25 +++-- 2 files changed, 35 insertions(+), 11

[PATCH v8 1/7] iommu/arm-smmu: Pass io-pgtable config to implementation specific function

2020-06-11 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-smmu-impl.c | 3 ++- drivers

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

2020-06-11 Thread Jordan Crouse
. Signed-off-by: Jordan Crouse --- Documentation/devicetree/bindings/iommu/arm,smmu.yaml | 4 1 file changed, 4 insertions(+) diff --git a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml index d7ceb4c34423..e52a1b146c97 100644

[PATCH v8 5/7] iommu/arm-smmu: Add implementation for the adreno GPU SMMU

2020-06-11 Thread Jordan Crouse
Add a special implementation for the SMMU attached to most Adreno GPU target triggered from the qcom,adreno-gpu-smmu compatible string. When selected the driver will attempt to enable split pagetables. Signed-off-by: Jordan Crouse --- drivers/iommu/arm-smmu-impl.c | 3 +++ drivers/iommu/arm

[PATCH 0/6] iommu-arm-smmu: Add auxiliary domains and per-instance pagetables

2020-06-11 Thread Jordan Crouse
://patchwork.kernel.org/patch/11600949/ Jordan Crouse (6): iommu/arm-smmu: Add auxiliary domain support for arm-smmuv2 iommu/io-pgtable: Allow a pgtable implementation to skip TLB operations iommu/arm-smmu: Add a domain attribute to pass the pagetable config drm/msm: Add support to create a local

[PATCH 2/6] iommu/io-pgtable: Allow a pgtable implementation to skip TLB operations

2020-06-11 Thread Jordan Crouse
Allow a io-pgtable implementation to skip TLB operations by checking for NULL pointers in the helper functions. It will be up to to the owner of the io-pgtable instance to make sure that they independently handle the TLB correctly. Signed-off-by: Jordan Crouse --- include/linux/io-pgtable.h

[PATCH 1/6] iommu/arm-smmu: Add auxiliary domain support for arm-smmuv2

2020-06-11 Thread Jordan Crouse
map and unmap iova addresses in the pagetable. Signed-off-by: Jordan Crouse --- drivers/iommu/arm-smmu.c | 216 --- drivers/iommu/arm-smmu.h | 1 + 2 files changed, 201 insertions(+), 16 deletions(-) diff --git a/drivers/iommu/arm-smmu.c b/drivers/iom

[PATCH 4/6] drm/msm: Add support to create a local pagetable

2020-06-11 Thread Jordan Crouse
-by: Jordan Crouse --- drivers/gpu/drm/msm/msm_gpummu.c | 2 +- drivers/gpu/drm/msm/msm_iommu.c | 180 ++- drivers/gpu/drm/msm/msm_mmu.h| 16 ++- 3 files changed, 195 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/msm/msm_gpummu.c b/drivers/gpu/drm

[PATCH 5/6] drm/msm: Add support for address space instances

2020-06-11 Thread Jordan Crouse
Add support for allocating an address space instance. Targets that support per-instance pagetables should implement their own function to allocate a new instance. The default will return the existing generic address space. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/msm_drv.c | 15

[PATCH 3/6] iommu/arm-smmu: Add a domain attribute to pass the pagetable config

2020-06-11 Thread Jordan Crouse
The Adreno GPU has the capacity to manage its own pagetables and switch them dynamically from the hardware. Add a domain attribute for arm-smmu-v2 to get the default pagetable configuration so that the GPU driver can match the format for its own pagetables. Signed-off-by: Jordan Crouse

[PATCH 6/6] drm/msm/a6xx: Add support for per-instance pagetables

2020-06-11 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 | 69 ++- drivers/gpu/drm/msm/msm_ringbuffer.h | 1 + 2 files changed, 69 insertions(+), 1 deletion(-) diff

[PATCH] iommu/arm-smmu: Add a init_context_bank implementation hook

2020-06-11 Thread Jordan Crouse
ng so could hang the GPU if one of the terminated transactions is a CP read. This depends on the arm-smmu adreno SMMU implementation [1]. [1] https://patchwork.kernel.org/patch/11600943/ Signed-off-by: Jordan Crouse --- drivers/iommu/arm-smmu-qcom.c | 13 + drivers/iommu/arm-s

Re: [PATCH 6/6] drm/msm/a6xx: Add support for per-instance pagetables

2020-06-12 Thread Jordan Crouse
On Thu, Jun 11, 2020 at 08:22:29PM -0700, Rob Clark wrote: > On Thu, Jun 11, 2020 at 3:29 PM Jordan Crouse wrote: > > > > Add support for using per-instance pagetables if all the dependencies are > > available. > > > > Signed-off-by: Jordan Crouse > >

Re: [PATCH 15/15] iommu/arm-smmu: Add context init implementation hook

2019-08-15 Thread Jordan Crouse
On Thu, Aug 15, 2019 at 01:09:07PM +0100, Robin Murphy wrote: > On 15/08/2019 11:56, Will Deacon wrote: > >On Fri, Aug 09, 2019 at 06:07:52PM +0100, Robin Murphy wrote: > >>Allocating and initialising a context for a domain is another point > >>where certain implementations are known to want specia

Re: [Freedreno] [PATCH v3 0/2] iommu/arm-smmu: Split pagetable support

2019-08-15 Thread Jordan Crouse
On Wed, Aug 07, 2019 at 04:21:38PM -0600, Jordan Crouse wrote: > (Sigh, resend. I freaked out my SMTP server) > > This is part of an ongoing evolution for enabling split pagetable support for > arm-smmu. Previous versions can be found [1]. > > In the discussion for v2 Robin poi

Re: [PATCH v3 1/2] iommu/io-pgtable-arm: Add support for ARM_ADRENO_GPU_LPAE io-pgtable format

2019-08-15 Thread Jordan Crouse
On Wed, Aug 07, 2019 at 04:21:39PM -0600, Jordan Crouse wrote: > Add a new sub-format ARM_ADRENO_GPU_LPAE to set up TTBR0 and TTBR1 for > use by the Adreno GPU. This will allow The GPU driver to map global > buffers in the TTBR1 and leave the TTBR0 configured but unset and > free t

Re: [Freedreno] [PATCH v3 0/2] iommu/arm-smmu: Split pagetable support

2019-08-16 Thread Jordan Crouse
On Fri, Aug 16, 2019 at 08:43:53PM +0100, Robin Murphy wrote: > On 16/08/2019 19:12, Rob Clark wrote: > >On Fri, Aug 16, 2019 at 9:58 AM Robin Murphy wrote: > >> > >>Hi Jordan, > >> > >>On 15/08/2019 16:33, Jordan Crouse wrote: > >>>On W

Re: [PATCH 4/4] iommu/io-pgtable-arm: Prepare for TTBR1 usage

2019-08-19 Thread Jordan Crouse
On Mon, Aug 19, 2019 at 07:19:31PM +0100, Robin Murphy wrote: > Now that callers are free to use a given table for TTBR1 if they wish > (all they need do is shift the provided attributes when constructing > their final TCR value), the only remaining impediment is the address > validation on map/unm

Re: [PATCH 3/4] iommu/io-pgtable-arm: Rationalise TCR handling

2019-08-20 Thread Jordan Crouse
On Tue, Aug 20, 2019 at 04:25:56PM +0100, Robin Murphy wrote: > On 20/08/2019 11:31, Will Deacon wrote: > >On Mon, Aug 19, 2019 at 07:19:30PM +0100, Robin Murphy wrote: > >>Although it's conceptually nice for the io_pgtable_cfg to provide a > >>standard VMSA TCR value, the reality is that no VMSA-c

[PATCH 3/7] iommu/arm-smmu: Add a SMMU variant for the Adreno GPU

2019-08-20 Thread Jordan Crouse
Add a SMMU model for the Adreno GPU and use it to enable split pagetable support if the conditions are right. Signed-off-by: Jordan Crouse --- drivers/iommu/arm-smmu-impl.c | 15 +++ drivers/iommu/arm-smmu.c | 2 ++ drivers/iommu/arm-smmu.h | 1 + 3 files changed, 18

[PATCH 1/7] iommu/arm-smmu: Support split pagetables

2019-08-20 Thread Jordan Crouse
for split pagetables on arm-smmu-v2 to date and it is the easiest configuration to support without a bunch of extra logic. Signed-off-by: Jordan Crouse --- drivers/iommu/arm-smmu.c | 41 + drivers/iommu/arm-smmu.h | 1 + 2 files changed, 38 insertions

[PATCH 4/7] iommu: Add DOMAIN_ATTR_SPLIT_TABLES

2019-08-20 Thread Jordan Crouse
Add a new attribute to query the state of split pagetables for the domain. 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 fdc355c..b06db6c 100644 --- a/include/linux/iommu.h +++ b

[PATCH 2/7] dt-bindings: arm-smmu: Add Adreno GPU variant

2019-08-20 Thread Jordan Crouse
Add a compatible string to identify SMMUs that are attached to Adreno GPU devices that wish to support split pagetables. Signed-off-by: Jordan Crouse --- Documentation/devicetree/bindings/iommu/arm,smmu.txt | 7 +++ 1 file changed, 7 insertions(+) diff --git a/Documentation/devicetree

[PATCH 0/7] iommu/arm-smmu: Split pagetable support for Adreno GPUs

2019-08-20 Thread Jordan Crouse
/pipermail/iommu/2019-August/038244.html [5] https://patchwork.freedesktop.org/patch/307601/ Jordan Crouse (7): iommu/arm-smmu: Support split pagetables dt-bindings: arm-smmu: Add Adreno GPU variant iommu/arm-smmu: Add a SMMU variant for the Adreno GPU iommu: Add DOMAIN_ATTR_SPLIT_TABLES

[PATCH 5/7] iommu/arm-smmu: Support DOMAIN_ATTR_SPLIT_TABLES

2019-08-20 Thread Jordan Crouse
Support the DOMAIN_ATTR_SPLIT_TABLES attribute to let the leaf driver know if split pagetables are enabled for the domain. Signed-off-by: Jordan Crouse --- drivers/iommu/arm-smmu.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index

Re: [PATCH 3/4] iommu/io-pgtable-arm: Rationalise TCR handling

2019-10-03 Thread Jordan Crouse
On Wed, Aug 21, 2019 at 01:56:20PM +0100, Robin Murphy wrote: > On 21/08/2019 13:11, Will Deacon wrote: > >On Tue, Aug 20, 2019 at 07:41:52PM +0100, Robin Murphy wrote: > >>On 20/08/2019 17:07, Will Deacon wrote: > >>>On Tue, Aug 20, 2019 at 04:25:56PM +0100, Robin Murphy wrote: > On 20/08/2019

Re: Users of IOMMU_QCOM_SYS_CACHE?

2019-10-24 Thread Jordan Crouse
On Thu, Oct 24, 2019 at 11:51:51AM +0100, Will Deacon wrote: > Hi all, > > In commit 90ec7a76cc4b ("iommu/io-pgtable-arm: Add support to use system > cache") we added support for IOMMU_QCOM_SYS_CACHE which was merged into 5.3. > This allows non-coherent devices to request an outer cacheable memory

Re: [PATCH] iommu/dma: Add support for DMA_ATTR_SYS_CACHE

2019-10-28 Thread Jordan Crouse
On Mon, Oct 28, 2019 at 11:59:04AM +, Robin Murphy wrote: > On 28/10/2019 11:24, Will Deacon wrote: > >Hi Christoph, > > > >On Mon, Oct 28, 2019 at 08:41:56AM +0100, Christoph Hellwig wrote: > >>On Sat, Oct 26, 2019 at 03:12:57AM -0700, isa...@codeaurora.org wrote: > >>>On 2019-10-25 22:30, Chr

Re: [PATCH 6/7] Revert "iommu/arm-smmu: Make arm-smmu explicitly non-modular"

2019-10-30 Thread Jordan Crouse
On Wed, Oct 30, 2019 at 02:51:11PM +, Will Deacon wrote: > This reverts commit addb672f200f4e99368270da205320b83efe01a0. > > Let's get the SMMU driver building as a module, which means putting > back some dead code that we used to carry. > > Signed-off-by: Will Deacon > --- > drivers/iommu/

Re: [PATCH 6/7] Revert "iommu/arm-smmu: Make arm-smmu explicitly non-modular"

2019-10-31 Thread Jordan Crouse
On Thu, Oct 31, 2019 at 12:03:28PM +, Will Deacon wrote: > On Wed, Oct 30, 2019 at 05:09:41PM -0600, Jordan Crouse wrote: > > On Wed, Oct 30, 2019 at 02:51:11PM +, Will Deacon wrote: > > > @@ -2235,12 +2237,16 @@ static const struct dev_pm_ops arm_smmu_pm_ops = { >

Re: [PATCH v2 09/10] iommu/io-pgtable-arm: Rationalise TCR handling

2019-11-04 Thread Jordan Crouse
On Mon, Nov 04, 2019 at 07:14:45PM +, Will Deacon wrote: > On Fri, Oct 25, 2019 at 07:08:38PM +0100, Robin Murphy wrote: > > Although it's conceptually nice for the io_pgtable_cfg to provide a > > standard VMSA TCR value, the reality is that no VMSA-compliant IOMMU > > looks exactly like an Arm

Re: [PATCH v2 10/10] iommu/io-pgtable-arm: Prepare for TTBR1 usage

2019-11-04 Thread Jordan Crouse
On Fri, Oct 25, 2019 at 07:08:39PM +0100, Robin Murphy wrote: > Now that we can correctly extract top-level indices without relying on > the remaining upper bits being zero, the only remaining impediments to > using a given table for TTBR1 are the address validation on map/unmap > and the awkward T

Re: [PATCH v2 10/10] iommu/io-pgtable-arm: Prepare for TTBR1 usage

2019-11-22 Thread Jordan Crouse
the awkward TCR translation granule format. Add a quirk so that we > can do the right thing at those points. Tested-by: Jordan Crouse > Signed-off-by: Robin Murphy > --- > drivers/iommu/io-pgtable-arm.c | 25 +++-- > include/linux/io-pgtable.h | 4

Re: [PATCH v2 09/10] iommu/io-pgtable-arm: Rationalise TCR handling

2019-11-22 Thread Jordan Crouse
> sizes and the walk attributes. Tested-by: Jordan Crouse > Signed-off-by: Robin Murphy > --- > drivers/iommu/arm-smmu-v3.c| 41 +++-- > drivers/iommu/arm-smmu.c | 7 ++- > drivers/iommu/arm-smmu.h | 27 > drivers/iommu/

Re: [PATCH v2 08/10] iommu/io-pgtable-arm: Rationalise TTBRn handling

2019-11-22 Thread Jordan Crouse
gt; representing the allocated table. This paves the way for future users to > support split address spaces by simply allocating a table and dealing > with the detailed TTBRn logistics themselves. Tested-by: Jordan Crouse > Signed-off-by: Robin Murphy > --- > drivers/iommu/arm-

[PATCH v2 3/8] iommu/arm-smmu: Pass io_pgtable_cfg to impl specific init_context

2019-11-22 Thread Jordan Crouse
Pass the propposed io_pgtable_cfg to the implementation specific init_context() function to give the implementation an opportunity to to modify it before it gets passed to io-pgtable. Signed-off-by: Jordan Crouse --- drivers/iommu/arm-smmu-impl.c | 3 ++- drivers/iommu/arm-smmu.c | 11

[PATCH v2 1/8] dt-bindings: arm-smmu: Add Adreno GPU variant

2019-11-22 Thread Jordan Crouse
Add a compatible string to identify SMMUs that are attached to Adreno GPU devices that wish to support split pagetables. Signed-off-by: Jordan Crouse --- Documentation/devicetree/bindings/iommu/arm,smmu.yaml | 6 ++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree

[PATCH v2 2/8] iommu: Add DOMAIN_ATTR_SPLIT_TABLES

2019-11-22 Thread Jordan Crouse
Add a new attribute to enable and query the state of split pagetables for the domain. 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 f2223cb..18c861e 100644 --- a/include/linux

[PATCH v2 0/8] iommu/arm-smmu: Split pagetable support for Adreno GPUs

2019-11-22 Thread Jordan Crouse
/iommu/2019-October/039720.html Jordan Crouse (8): dt-bindings: arm-smmu: Add Adreno GPU variant iommu: Add DOMAIN_ATTR_SPLIT_TABLES iommu/arm-smmu: Pass io_pgtable_cfg to impl specific init_context iommu/arm-smmu: Add split pagetables for Adreno IOMMU implementations drm/msm: Attach the

[PATCH v2 5/8] drm/msm: Attach the IOMMU device during initialization

2019-11-22 Thread Jordan Crouse
aggressive cleanups that follow. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 8 drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c | 4 drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c | 7 --- drivers/gpu/drm/msm/msm_gem_vma.c| 23

[PATCH v2 4/8] iommu/arm-smmu: Add split pagetables for Adreno IOMMU implementations

2019-11-22 Thread Jordan Crouse
successfully programmed. The domain geometry will be updated so that the caller can determine the start of the region to generate correct virtual addresses. Signed-off-by: Jordan Crouse --- drivers/iommu/arm-smmu-impl.c | 3 ++ drivers/iommu/arm-smmu-qcom.c | 96

[PATCH v2 8/8] arm64: dts: qcom: sdm845: Update Adreno GPU SMMU compatible string

2019-11-22 Thread Jordan Crouse
Add "qcom,adreno-smmu-v2" compatible string for the Adreno GPU SMMU node to enable split pagetable support. 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/sdm845.dt

[PATCH v2 7/8] drm/msm/a6xx: Support split pagetables

2019-11-22 Thread Jordan Crouse
start swapping TTBR0 for context-specific pagetables. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 46 ++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno

[PATCH v2 6/8] drm/msm: Refactor address space initialization

2019-11-22 Thread Jordan Crouse
functions to create the address space so a2xx can do its own thing in its own space. For all the other targets use a generic helper to initialize IOMMU but leave the door open for newer targets to use customization if they need it. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/adreno/a2xx_gpu.c

Re: [PATCH v2 4/8] iommu/arm-smmu: Add split pagetables for Adreno IOMMU implementations

2019-12-05 Thread Jordan Crouse
On Wed, Dec 04, 2019 at 04:44:59PM +, Robin Murphy wrote: > On 22/11/2019 11:31 pm, Jordan Crouse wrote: > >Add implementation specific support to enable split pagetables for > >SMMU implementations attached to Adreno GPUs on Qualcomm targets. > > > >To enable split

[PATCH v3 1/5] iommu: Add DOMAIN_ATTR_SPLIT_TABLES

2019-12-16 Thread Jordan Crouse
Add a new attribute to enable and query the state of split pagetables for the domain. 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 f2223cb..18c861e 100644 --- a/include/linux

[PATCH v3 0/5] iommu/arm-smmu: Split pagetable support for arm-smmu-v2

2019-12-16 Thread Jordan Crouse
/pipermail/iommu/2019-October/039718.html [2] https://lists.linuxfoundation.org/pipermail/iommu/2019-October/039719.html [3] https://lists.linuxfoundation.org/pipermail/iommu/2019-October/039720.html Jordan Crouse (5): iommu: Add DOMAIN_ATTR_SPLIT_TABLES iommu/arm-smmu: Add support for split

  1   2   3   4   >