Skip to content
Commit 1c753d00 authored by Bartosz Golaszewski's avatar Bartosz Golaszewski Committed by Bjorn Andersson
Browse files

firmware: qcom: tzmem: fix virtual-to-physical address conversion



We currently only correctly convert the virtual address passed by the
caller to qcom_tzmem_to_phys() if it corresponds to the base address of
the chunk. If the user wants to convert some pointer at an offset
relative to that base address, we'll return 0. Let's change the
implementation of qcom_tzmem_to_phys(): iterate over the chunks and try
to call gen_pool_virt_to_phys() just-in-time instead of trying to call
it only once when creating the chunk.

Fixes: 84f5a7b6 ("firmware: qcom: add a dedicated TrustZone buffer allocator")
Reported-by: default avatarJohan Hovold <johan+linaro@kernel.org>
Closes: https://lore.kernel.org/lkml/20240729095542.21097-1-johan+linaro@kernel.org/


Acked-by: default avatarAndrew Halaney <ahalaney@redhat.com>
Signed-off-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://lore.kernel.org/r/20240731-tzmem-efivars-fix-v2-1-f0e84071ec07@linaro.org


Signed-off-by: default avatarBjorn Andersson <andersson@kernel.org>
parent 9960085a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment