]> www.infradead.org Git - users/jedix/linux-maple.git/commit
firmware: qcom: add a dedicated TrustZone buffer allocator
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Mon, 27 May 2024 12:54:52 +0000 (14:54 +0200)
committerBjorn Andersson <andersson@kernel.org>
Sun, 23 Jun 2024 21:08:04 +0000 (16:08 -0500)
commit84f5a7b67b61bfeb0a939ddc5eca8586cae101de
treee99d1e7834893040a517c964e1d82d35b90f1e05
parent9164d2be21d42a0263b80af709fa40879c7f52be
firmware: qcom: add a dedicated TrustZone buffer allocator

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@linaro.org>
Reviewed-by: Andrew Halaney <ahalaney@redhat.com>
Tested-by: Andrew Halaney <ahalaney@redhat.com> # sc8280xp-lenovo-thinkpad-x13s
Tested-by: Deepti Jaggi <quic_djaggi@quicinc.com> #sa8775p-ride
Reviewed-by: Elliot Berman <quic_eberman@quicinc.com>
Link: https://lore.kernel.org/r/20240527-shm-bridge-v10-2-ce7afaa58d3a@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
MAINTAINERS
drivers/firmware/qcom/Kconfig
drivers/firmware/qcom/Makefile
drivers/firmware/qcom/qcom_tzmem.c [new file with mode: 0644]
drivers/firmware/qcom/qcom_tzmem.h [new file with mode: 0644]
include/linux/firmware/qcom/qcom_tzmem.h [new file with mode: 0644]