]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
firmware: qcom: scm: clarify the comment in qcom_scm_pas_init_image()
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Mon, 27 May 2024 12:55:03 +0000 (14:55 +0200)
committerBjorn Andersson <andersson@kernel.org>
Sun, 23 Jun 2024 21:08:43 +0000 (16:08 -0500)
The "memory protection" mechanism mentioned in the comment is the SHM
Bridge. This is also the reason why we do not convert this call to using
the TZ memory allocator.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
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-13-ce7afaa58d3a@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
drivers/firmware/qcom/qcom_scm.c

index df748fa8af4d4106e9f6f1991c18c768064cf772..00c379a3ccebeb170dc21f2290819cdbb46b8061 100644 (file)
@@ -582,6 +582,13 @@ int qcom_scm_pas_init_image(u32 peripheral, const void *metadata, size_t size,
         * During the scm call memory protection will be enabled for the meta
         * data blob, so make sure it's physically contiguous, 4K aligned and
         * non-cachable to avoid XPU violations.
+        *
+        * For PIL calls the hypervisor creates SHM Bridges for the blob
+        * buffers on behalf of Linux so we must not do it ourselves hence
+        * not using the TZMem allocator here.
+        *
+        * If we pass a buffer that is already part of an SHM Bridge to this
+        * call, it will fail.
         */
        mdata_buf = dma_alloc_coherent(__scm->dev, size, &mdata_phys,
                                       GFP_KERNEL);