* [PATCH v10 00/13] iommu/arm-smmu: Add Adreno SMMU specific implementation
@ 2020-07-20 15:40 Jordan Crouse
2020-07-20 15:40 ` [PATCH v10 07/13] dt-bindings: arm-smmu: Add compatible string for Adreno GPU SMMU Jordan Crouse
2020-07-20 15:40 ` [PATCH v10 13/13] arm: dts: qcom: sm845: Set the compatible string for the " Jordan Crouse
0 siblings, 2 replies; 4+ messages in thread
From: Jordan Crouse @ 2020-07-20 15:40 UTC (permalink / raw)
To: linux-arm-msm
Cc: Robin Murphy, Bjorn Andersson, Will Deacon, freedreno, iommu,
Sai Prakash Ranjan, Akhil P Oommen, Andy Gross,
AngeloGioacchino Del Regno, Ben Dooks, Brian Masney,
Daniel Vetter, David Airlie, Emil Velikov, Eric Anholt,
Joerg Roedel, John Stultz, Jonathan Marek, Rob Clark, Rob Herring,
Sean Paul, Sharat Masetty, Shawn Guo, Wambui Karuga, devicetree,
dri-devel, linux-arm-kernel, linux-kernel
(reworded the summary to reflect ongoing changes in the code)
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 HW capabilities there are certain
requirements needed of the SMMU hardware.
This series adds support for an Adreno specific arm-smmu implementation. The new
implementation 1) ensures that the GPU domain is always assigned context bank 0,
2) enables split pagetable support (TTBR1) so that the instance specific
pagetable can be swapped while the global memory remains in place and 3) shares
the current pagetable configuration with the GPU driver to allow it to create
its own io-pgtable instances.
The series then adds the drm/msm code to enable these features. For targets that
support it allocate new pagetables using the io-pgtable configuration shared by
the arm-smmu driver and swap them in during runtime.
This version of the series merges the previous patchset(s) [1] and [2]
with the following improvements:
- arm-smmu: add implementation hook to allocate context banks
- arm-smmu: Match the GPU domain by stream ID instead of compatible string
- arm-smmu: Make DOMAIN_ATTR_PGTABLE_CFG bi-directional. The leaf driver
queries the configuration to create a pagetable and then sends the newly
created configuration back to the smmu-driver to enable TTBR0
- drm/msm: Add context reference counting for submissions
- drm/msm: Use dummy functions to skip TLB operations on per-instance
pagetables
[1] https://lists.linuxfoundation.org/pipermail/iommu/2020-June/045653.html
[2] https://lists.linuxfoundation.org/pipermail/iommu/2020-June/045659.html
Jordan Crouse (13):
iommu/arm-smmu: Pass io-pgtable config to implementation specific
function
iommu/arm-smmu: Add support for split pagetables
iommu/arm-smmu: Add implementation hooks to configure contexts
iommu/arm-smmu-qcom: Add implementation for the adreno GPU SMMU
iommu: Add a domain attribute to get/set a pagetable configuration
iommu/arm-smmu-qcom: Get and set the pagetable config for split
pagetables
dt-bindings: arm-smmu: Add compatible string for Adreno GPU SMMU
drm/msm: Add a context pointer to the submitqueue
drm/msm: Set the global virtual address range from the IOMMU domain
drm/msm: Add support to create a local pagetable
drm/msm: Add support for private address space instances
drm/msm/a6xx: Add support for per-instance pagetables
arm: dts: qcom: sm845: Set the compatible string for the GPU SMMU
.../devicetree/bindings/iommu/arm,smmu.yaml | 4 +
arch/arm64/boot/dts/qcom/sdm845.dtsi | 2 +-
drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 12 +-
drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 58 ++++-
drivers/gpu/drm/msm/adreno/a6xx_gpu.h | 1 +
drivers/gpu/drm/msm/adreno/adreno_gpu.c | 18 +-
drivers/gpu/drm/msm/adreno/adreno_gpu.h | 3 +-
drivers/gpu/drm/msm/msm_drv.c | 16 +-
drivers/gpu/drm/msm/msm_drv.h | 13 ++
drivers/gpu/drm/msm/msm_gem.h | 1 +
drivers/gpu/drm/msm/msm_gem_submit.c | 8 +-
drivers/gpu/drm/msm/msm_gem_vma.c | 9 +
drivers/gpu/drm/msm/msm_gpu.c | 26 ++-
drivers/gpu/drm/msm/msm_gpu.h | 12 +-
drivers/gpu/drm/msm/msm_gpummu.c | 2 +-
drivers/gpu/drm/msm/msm_iommu.c | 198 +++++++++++++++++-
drivers/gpu/drm/msm/msm_mmu.h | 16 +-
drivers/gpu/drm/msm/msm_ringbuffer.h | 1 +
drivers/gpu/drm/msm/msm_submitqueue.c | 8 +-
drivers/iommu/arm-smmu-impl.c | 6 +-
drivers/iommu/arm-smmu-qcom.c | 130 +++++++++++-
drivers/iommu/arm-smmu.c | 108 +++++-----
drivers/iommu/arm-smmu.h | 65 +++++-
include/linux/iommu.h | 1 +
24 files changed, 619 insertions(+), 99 deletions(-)
--
2.25.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v10 07/13] dt-bindings: arm-smmu: Add compatible string for Adreno GPU SMMU
2020-07-20 15:40 [PATCH v10 00/13] iommu/arm-smmu: Add Adreno SMMU specific implementation Jordan Crouse
@ 2020-07-20 15:40 ` Jordan Crouse
2020-07-26 16:55 ` Rob Clark
2020-07-20 15:40 ` [PATCH v10 13/13] arm: dts: qcom: sm845: Set the compatible string for the " Jordan Crouse
1 sibling, 1 reply; 4+ messages in thread
From: Jordan Crouse @ 2020-07-20 15:40 UTC (permalink / raw)
To: linux-arm-msm
Cc: Robin Murphy, Bjorn Andersson, Will Deacon, freedreno, iommu,
Sai Prakash Ranjan, Rob Herring, Joerg Roedel, Rob Herring,
devicetree, linux-arm-kernel, linux-kernel
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.
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Reviewed-by: Rob Herring <robh@kernel.org>
---
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
--- a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
+++ b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
@@ -38,6 +38,10 @@ properties:
- qcom,sc7180-smmu-500
- qcom,sdm845-smmu-500
- const: arm,mmu-500
+ - description: Qcom Adreno GPUs implementing "arm,smmu-v2"
+ items:
+ - const: qcom,adreno-smmu
+ - const: qcom,smmu-v2
- items:
- const: arm,mmu-500
- const: arm,smmu-v2
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v10 07/13] dt-bindings: arm-smmu: Add compatible string for Adreno GPU SMMU
2020-07-20 15:40 ` [PATCH v10 07/13] dt-bindings: arm-smmu: Add compatible string for Adreno GPU SMMU Jordan Crouse
@ 2020-07-26 16:55 ` Rob Clark
0 siblings, 0 replies; 4+ messages in thread
From: Rob Clark @ 2020-07-26 16:55 UTC (permalink / raw)
To: Jordan Crouse
Cc: linux-arm-msm, Rob Herring, Linux Kernel Mailing List,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
freedreno, Robin Murphy,
list@263.net:IOMMU DRIVERS <iommu@lists.linux-foundation.org>, Joerg Roedel <joro@8bytes.org>,,
Rob Herring, Will Deacon,
moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE
On Mon, Jul 20, 2020 at 8:41 AM Jordan Crouse <jcrouse@codeaurora.org> wrote:
>
> Every Qcom Adreno GPU has an embedded SMMU for its own use. These
minor detail: this is true for a3xx and later but not a2xx ;-)
> 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.
>
> Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
> Reviewed-by: Rob Herring <robh@kernel.org>
> ---
>
> 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
> --- a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
> +++ b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
> @@ -38,6 +38,10 @@ properties:
> - qcom,sc7180-smmu-500
> - qcom,sdm845-smmu-500
> - const: arm,mmu-500
> + - description: Qcom Adreno GPUs implementing "arm,smmu-v2"
> + items:
> + - const: qcom,adreno-smmu
> + - const: qcom,smmu-v2
> - items:
> - const: arm,mmu-500
> - const: arm,smmu-v2
> --
> 2.25.1
>
> _______________________________________________
> iommu mailing list
> iommu@lists.linux-foundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/iommu
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v10 13/13] arm: dts: qcom: sm845: Set the compatible string for the GPU SMMU
2020-07-20 15:40 [PATCH v10 00/13] iommu/arm-smmu: Add Adreno SMMU specific implementation Jordan Crouse
2020-07-20 15:40 ` [PATCH v10 07/13] dt-bindings: arm-smmu: Add compatible string for Adreno GPU SMMU Jordan Crouse
@ 2020-07-20 15:40 ` Jordan Crouse
1 sibling, 0 replies; 4+ messages in thread
From: Jordan Crouse @ 2020-07-20 15:40 UTC (permalink / raw)
To: linux-arm-msm
Cc: Robin Murphy, Bjorn Andersson, Will Deacon, freedreno, iommu,
Sai Prakash Ranjan, Andy Gross, Rob Herring, devicetree,
linux-kernel
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 <jcrouse@codeaurora.org>
---
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/sdm845.dtsi
index 759cdd0b002b..d883144360aa 100644
--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
@@ -3981,7 +3981,7 @@ opp-257000000 {
};
adreno_smmu: iommu@5040000 {
- compatible = "qcom,sdm845-smmu-v2", "qcom,smmu-v2";
+ compatible = "qcom,adreno-smmu", "qcom,smmu-v2";
reg = <0 0x5040000 0 0x10000>;
#iommu-cells = <1>;
#global-interrupts = <2>;
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-07-26 16:54 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-20 15:40 [PATCH v10 00/13] iommu/arm-smmu: Add Adreno SMMU specific implementation Jordan Crouse
2020-07-20 15:40 ` [PATCH v10 07/13] dt-bindings: arm-smmu: Add compatible string for Adreno GPU SMMU Jordan Crouse
2020-07-26 16:55 ` Rob Clark
2020-07-20 15:40 ` [PATCH v10 13/13] arm: dts: qcom: sm845: Set the compatible string for the " Jordan Crouse
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).