refactor: mailbox doesn't need size and sender
The mailbox structure doesn't need to keep track of the
sender ID and the size for memory sharing ABIs.
Signed-off-by: J-Alves <joao.alves@arm.com>
Change-Id: If1a7731c9cbaab04360a5ffeb4be4a8342b50280
diff --git a/src/arch/aarch64/plat/ffa/hypervisor.c b/src/arch/aarch64/plat/ffa/hypervisor.c
index 860adf8..cbaea0b 100644
--- a/src/arch/aarch64/plat/ffa/hypervisor.c
+++ b/src/arch/aarch64/plat/ffa/hypervisor.c
@@ -1179,17 +1179,16 @@
/** Forwards a memory send message on to the other world. */
static struct ffa_value memory_send_other_world_forward(
- struct vm_locked other_world_locked, ffa_id_t sender_vm_id,
- uint32_t share_func, struct ffa_memory_region *memory_region,
- uint32_t memory_share_length, uint32_t fragment_length)
+ struct vm_locked other_world_locked, uint32_t share_func,
+ struct ffa_memory_region *memory_region, uint32_t memory_share_length,
+ uint32_t fragment_length)
{
struct ffa_value ret;
/* Use its own RX buffer. */
memcpy_s(other_world_locked.vm->mailbox.recv, FFA_MSG_PAYLOAD_MAX,
memory_region, fragment_length);
- other_world_locked.vm->mailbox.recv_size = fragment_length;
- other_world_locked.vm->mailbox.recv_sender = sender_vm_id;
+
other_world_locked.vm->mailbox.recv_func = share_func;
other_world_locked.vm->mailbox.state = MAILBOX_STATE_FULL;
ret = arch_other_world_call(
@@ -1250,8 +1249,8 @@
/* Forward memory send message on to other world. */
ret = memory_send_other_world_forward(
- to_locked, from_locked.vm->id, share_func,
- memory_region, memory_share_length, fragment_length);
+ to_locked, share_func, memory_region,
+ memory_share_length, fragment_length);
if (ret.func != FFA_SUCCESS_32) {
dlog_verbose(
"%s: failed to forward memory send message to "
@@ -1314,8 +1313,8 @@
* have so far.
*/
ret = memory_send_other_world_forward(
- to_locked, from_locked.vm->id, share_func,
- memory_region, memory_share_length, fragment_length);
+ to_locked, share_func, memory_region,
+ memory_share_length, fragment_length);
if (ret.func != FFA_MEM_FRAG_RX_32) {
dlog_warning(
"%s: failed to forward to other world: "
@@ -1640,8 +1639,7 @@
memcpy_s(other_world_locked.vm->mailbox.recv, FFA_MSG_PAYLOAD_MAX,
fragment, fragment_length);
- other_world_locked.vm->mailbox.recv_size = fragment_length;
- other_world_locked.vm->mailbox.recv_sender = sender_vm_id;
+
other_world_locked.vm->mailbox.recv_func = FFA_MEM_FRAG_TX_32;
other_world_locked.vm->mailbox.state = MAILBOX_STATE_FULL;
ret = arch_other_world_call(
diff --git a/src/ffa_memory.c b/src/ffa_memory.c
index 8641d5b..504308c 100644
--- a/src/ffa_memory.c
+++ b/src/ffa_memory.c
@@ -3263,8 +3263,7 @@
share_state->fragment_constituent_counts[fragment_index],
&fragment_length);
CHECK(remaining_constituent_count == 0);
- to_locked.vm->mailbox.recv_size = fragment_length;
- to_locked.vm->mailbox.recv_sender = HF_HYPERVISOR_VM_ID;
+
to_locked.vm->mailbox.recv_func = FFA_MEM_FRAG_TX_32;
to_locked.vm->mailbox.state = MAILBOX_STATE_FULL;