]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
firmware: qcom_scm: Add a prep version of auth_and_reset function
authorMukesh Ojha <mukesh.ojha@oss.qualcomm.com>
Mon, 5 Jan 2026 13:22:56 +0000 (18:52 +0530)
committerBjorn Andersson <andersson@kernel.org>
Tue, 13 Jan 2026 18:14:34 +0000 (12:14 -0600)
commit4a7d6a78fbc6527fb1b61944aab00d9cdd1d4f01
tree7d092f1fc7d668bf4601ea5d8cdf3d7e62be8ca8
parent928dbaaa9d89363d79e309ec00c5527ddfbe47c8
firmware: qcom_scm: Add a prep version of auth_and_reset function

For memory passed to TrustZone (TZ), it must either be part of a pool
registered with TZ or explicitly registered via SHMbridge SMC calls.
When Gunyah hypervisor is present, PAS SMC calls from Linux running at
EL1 are trapped by Gunyah running @ EL2, which handles SHMbridge
creation for both metadata and remoteproc carveout memory before
invoking the calls to TZ.

On SoCs running with a non-Gunyah-based hypervisor, Linux must take
responsibility for creating the SHM bridge before invoking PAS SMC
calls. For the auth_and_reset() call, the remoteproc carveout memory
must first be registered with TZ via a SHMbridge SMC call and once
authentication and reset are complete, the SHMbridge memory can be
deregistered.

Introduce qcom_scm_pas_prepare_and_auth_reset(), which sets up the SHM
bridge over the remoteproc carveout memory when Linux operates at EL2.
This behavior is indicated by a new field added to the PAS context data
structure. The function then invokes the auth_and_reset SMC call.

Signed-off-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20260105-kvmrprocv10-v10-8-022e96815380@oss.qualcomm.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
drivers/firmware/qcom/qcom_scm.c
include/linux/firmware/qcom/qcom_scm.h