refactor(memory share): reclaim from other world
The memory reclaim has been refactored to better differentiate
SPMC's and Hypervisor's implementation.
The functions that operate a memory reclaim targetting the other
world, are moved to the plat/ffa module:
- The SPMC returns ffa_error(FFA_INVALID_PARAMETER), as it considers
to have received an invalid memory handle.
- The Hypervisor delegates the tracking of the memory region to
the SPMC if there is a SP involved, either as the Sender or as
a receiver. As such, all functions doing memory reclaim with
the other world (i.e. the secure world) that were defined in
`ffa_memory.c` have been moved to `plat/ffa/hypervisor.c`.
Few functions from ffa_memory.c were made public to be
invoked in 'plat/ffa/hypervisor.c'.
Change-Id: Idff0dae89ca8b6c99d33632bb4401decc368b7e5
Signed-off-by: J-Alves <joao.alves@arm.com>
diff --git a/src/api.c b/src/api.c
index 8421449..cb6f779 100644
--- a/src/api.c
+++ b/src/api.c
@@ -3071,15 +3071,8 @@
vm_unlock(&to_locked);
} else {
- struct vm *from = vm_find(HF_TEE_VM_ID);
- struct two_vm_locked vm_to_from_lock = vm_lock_both(to, from);
-
- ret = ffa_memory_other_world_reclaim(
- vm_to_from_lock.vm1, vm_to_from_lock.vm2, handle, flags,
- &api_page_pool);
-
- vm_unlock(&vm_to_from_lock.vm1);
- vm_unlock(&vm_to_from_lock.vm2);
+ ret = plat_ffa_other_world_mem_reclaim(to, handle, flags,
+ &api_page_pool);
}
return ret;