| From 96d226e4e0ea9c633dbc5d05ae2a7a2f4ba0f39e Mon Sep 17 00:00:00 2001 |
| From: Imre Kis <imre.kis@arm.com> |
| Date: Fri, 22 Jul 2022 17:22:05 +0200 |
| Subject: [PATCH 23/24] Change MM communicate RPC protocol of MM caller |
| |
| Replace buffer address and size parameter by offset in buffer parameter |
| and move to 64 bit FF-A direct message call. This change requires an |
| updated version of the debugfs driver which supports 64 bit direct |
| messages. |
| |
| Signed-off-by: Imre Kis <imre.kis@arm.com> |
| Change-Id: I003c1de7f9c3f45bbc52e4a51d622ec960fa7052 |
| |
| Upstream-Status: Pending [In review] |
| Signed-off-by: Anton Antonov <Anton.Antonov@arm.com> |
| |
| --- |
| .../caller/linux/mm_communicate_caller.c | 35 +++++++------------ |
| .../LinuxFFAUserShim/LinuxFFAUserShim.cmake | 2 +- |
| 2 files changed, 14 insertions(+), 23 deletions(-) |
| |
| diff --git a/components/rpc/mm_communicate/caller/linux/mm_communicate_caller.c b/components/rpc/mm_communicate/caller/linux/mm_communicate_caller.c |
| index 0c505b4..0287acf 100644 |
| --- a/components/rpc/mm_communicate/caller/linux/mm_communicate_caller.c |
| +++ b/components/rpc/mm_communicate/caller/linux/mm_communicate_caller.c |
| @@ -19,7 +19,7 @@ |
| #include <string.h> |
| #include <errno.h> |
| |
| -#define KERNEL_MOD_REQ_VER_MAJOR 2 |
| +#define KERNEL_MOD_REQ_VER_MAJOR 5 |
| #define KERNEL_MOD_REQ_VER_MINOR 0 |
| #define KERNEL_MOD_REQ_VER_PATCH 0 |
| |
| @@ -294,37 +294,28 @@ static rpc_status_t call_invoke( |
| |
| direct_msg.dst_id = s->dest_partition_id; |
| |
| - direct_msg.args[MM_COMMUNICATE_CALL_ARGS_COMM_BUFFER_ADDRESS] = (uintptr_t)s->comm_buffer; |
| - direct_msg.args[MM_COMMUNICATE_CALL_ARGS_COMM_BUFFER_SIZE] = s->comm_buffer_size; |
| + direct_msg.args[MM_COMMUNICATE_CALL_ARGS_COMM_BUFFER_OFFSET] = 0; |
| |
| int kernel_op_status = ioctl(s->ffa_fd, FFA_IOC_MSG_SEND, &direct_msg); |
| |
| if (kernel_op_status == 0) { |
| - |
| /* Kernel send operation completed normally */ |
| - uint32_t mm_return_id = direct_msg.args[MM_COMMUNICATE_CALL_ARGS_RETURN_ID]; |
| int32_t mm_return_code = direct_msg.args[MM_COMMUNICATE_CALL_ARGS_RETURN_CODE]; |
| |
| - if (mm_return_id == ARM_SVC_ID_SP_EVENT_COMPLETE) { |
| - |
| - if (mm_return_code == MM_RETURN_CODE_SUCCESS) { |
| - |
| - mm_communicate_serializer_header_decode(s->serializer, |
| - s->comm_buffer, (efi_status_t*)opstatus, resp_buf, resp_len); |
| - |
| - if (*resp_len > s->req_len) { |
| + if (mm_return_code == MM_RETURN_CODE_SUCCESS) { |
| + mm_communicate_serializer_header_decode( |
| + s->serializer, s->comm_buffer, (efi_status_t *)opstatus, |
| + resp_buf, resp_len); |
| |
| - s->scrub_len = |
| - mm_communicate_serializer_header_size(s->serializer) + |
| - *resp_len; |
| - } |
| + if (*resp_len > s->req_len) |
| + s->scrub_len = |
| + mm_communicate_serializer_header_size( |
| + s->serializer) + *resp_len; |
| |
| - rpc_status = TS_RPC_CALL_ACCEPTED; |
| - } |
| - else { |
| + rpc_status = TS_RPC_CALL_ACCEPTED; |
| + } else { |
| |
| - rpc_status = mm_return_code_to_rpc_status(mm_return_code); |
| - } |
| + rpc_status = mm_return_code_to_rpc_status(mm_return_code); |
| } |
| } |
| } |
| diff --git a/external/LinuxFFAUserShim/LinuxFFAUserShim.cmake b/external/LinuxFFAUserShim/LinuxFFAUserShim.cmake |
| index 7ba64af..9c2252c 100644 |
| --- a/external/LinuxFFAUserShim/LinuxFFAUserShim.cmake |
| +++ b/external/LinuxFFAUserShim/LinuxFFAUserShim.cmake |
| @@ -11,7 +11,7 @@ |
| |
| set(LINUX_FFA_USER_SHIM_URL "https://git.gitlab.arm.com/linux-arm/linux-trusted-services.git" |
| CACHE STRING "Linux FF-A user space shim repository URL") |
| -set(LINUX_FFA_USER_SHIM_REFSPEC "v4.0.0" |
| +set(LINUX_FFA_USER_SHIM_REFSPEC "v5.0.0" |
| CACHE STRING "Linux FF-A user space shim git refspec") |
| |
| set(LINUX_FFA_USER_SHIM_SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/_deps/linux_ffa_user_shim-src" |
| -- |
| 2.17.1 |
| |