[PATCH v8 01/12] firmware: qcom: add a dedicated TrustZone buffer allocator

Jeff Johnson quic_jjohnson at quicinc.com
Mon Mar 4 08:07:16 PST 2024


On 3/3/2024 7:01 AM, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bartosz.golaszewski at linaro.org>
> 
> We have several SCM calls that require passing buffers to the TrustZone
> on top of the SMC core which allocates memory for calls that require
> more than 4 arguments.
> 
> Currently every user does their own thing which leads to code
> duplication. Many users call dma_alloc_coherent() for every call which
> is terribly unperformant (speed- and size-wise).
> 
> Provide a set of library functions for creating and managing pools of
> memory which is suitable for sharing with the TrustZone, that is:
> page-aligned, contiguous and non-cachable as well as provides a way of
> mapping of kernel virtual addresses to physical space.
> 
> Make the allocator ready for extending with additional modes of operation
> which will allow us to support the SHM bridge safety mechanism once all
> users convert.
> 
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski at linaro.org>
> Reviewed-by: Andrew Halaney <ahalaney at redhat.com>
> Tested-by: Andrew Halaney <ahalaney at redhat.com> # sc8280xp-lenovo-thinkpad-x13s
> Tested-by: Deepti Jaggi <quic_djaggi at quicinc.com> #sa8775p-ride
> Reviewed-by: Elliot Berman <quic_eberman at quicinc.com>
> ---
>  MAINTAINERS                              |   8 +
>  drivers/firmware/qcom/Kconfig            |  20 ++
>  drivers/firmware/qcom/Makefile           |   1 +
>  drivers/firmware/qcom/qcom_tzmem.c       | 392 +++++++++++++++++++++++
>  drivers/firmware/qcom/qcom_tzmem.h       |  13 +
>  include/linux/firmware/qcom/qcom_tzmem.h |  56 ++++
>  6 files changed, 490 insertions(+)
>  create mode 100644 drivers/firmware/qcom/qcom_tzmem.c
>  create mode 100644 drivers/firmware/qcom/qcom_tzmem.h
>  create mode 100644 include/linux/firmware/qcom/qcom_tzmem.h
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 1794b8d7c76b..c1138c709365 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -18327,6 +18327,14 @@ L:	linux-arm-msm at vger.kernel.org
>  S:	Maintained
>  F:	drivers/firmware/qcom/qcom_qseecom.c
>  
> +QUALCOMM TRUST ZONE MEMORY ALLOCATOR
> +M:	Bartosz Golaszewski <bartosz.golaszewski at linaro.org>
> +L:	linux-arm-msm at vger.kernel.org
> +S:	Maintained
> +F:	drivers/firmware/qcom/qcom_tzmem.c
> +F:	drivers/firmware/qcom/qcom_tzmem.h
> +F:	include/linux/firmware/qcom/qcom_tzmem.h
> +
>  QUALCOMM QSEECOM UEFISECAPP DRIVER
>  M:	Maximilian Luz <luzmaximilian at gmail.com>
>  L:	linux-arm-msm at vger.kernel.org

entries should be in alphabetic order so at a minimum QUALCOMM TRUST...
should be after QUALCOMM QSEECOM...

seems your addition belong just before QUALCOMM TSENS THERMAL DRIVER

/jeff



More information about the linux-arm-kernel mailing list