Commit b0426ab6 authored by Elliot Berman's avatar Elliot Berman Committed by Carlos Llamas
Browse files

BACKPORT: misc: fastrpc: Pass bitfield into qcom_scm_assign_mem



The srcvm parameter of qcom_scm_assign_mem is a pointer to a bitfield of
VMIDs. The  bitfield is updated with which VMIDs have permissions
after the qcom_scm_assign_mem call. This makes it simpler for clients to
make qcom_scm_assign_mem calls later, they always pass in same srcvm
bitfield and do not need to closely track whether memory was originally
shared.

When restoring permissions to HLOS, fastrpc is incorrectly using the
first VMID directly -- neither the BIT nor the other possible VMIDs the
memory was already assigned to.  We already have a field intended for
this purpose: "perms" in the struct fastrpc_channel_ctx, but it was
never used. Start using the perms field.

Cc: Abel Vesa <abel.vesa@linaro.org>
Cc: Vamsi Krishna Gattupalli <quic_vgattupa@quicinc.com>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Fixes: e90d9119 ("misc: fastrpc: Add support to secure memory map")
Fixes: 08715610 ("misc: fastrpc: Add support for audiopd")
Fixes: 532ad70c ("misc: fastrpc: Add mmap request assigning for static PD pool")
Tested-by: default avatarSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: default avatarElliot Berman <quic_eberman@quicinc.com>

drivers/misc/fastrpc.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

Link: https://lore.kernel.org/r/20230112182313.521467-1-quic_eberman@quicinc.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 279506910
(cherry picked from commit aaca766c)
[eberman: Drop modifications to qcom_scm_assign_mem not in 14-6.1]
Change-Id: I9eff564504fa277519245a446eb6fcad41a0ee42
Signed-off-by: default avatarElliot Berman <quic_eberman@quicinc.com>
parent 2220f819
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment