[PATCH v4 04/15] firmware: qcom: add a dedicated TrustZone buffer allocator

Andrew Halaney ahalaney at redhat.com
Fri Oct 13 07:59:03 PDT 2023


On Fri, Oct 13, 2023 at 01:48:32PM +0200, 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 pool 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.
> 
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski at linaro.org>

I'm still on the fence about introducing the Kconfig for the "just
in case the hypervisor is bad on some boards", but I spent a
while looking at this and it all looks good to me, so that opinion
aside...

Reviewed-by: Andrew Halaney <ahalaney at redhat.com>




More information about the linux-arm-kernel mailing list