fix(memory share): relinquish from VM
The SPMC could receive a relinquish request from a NWd VM.
In a previous patch there was a change to avoid updating any of
the PTs, given SPMC doesn't operate S2 PTs for VMs.
Additionally, some of the checks were still specific to endpoints
at the virtual FF-A instance.
Change-Id: I5395bbe3108f4bd599897e5de360d389b49ad84b
Signed-off-by: J-Alves <joao.alves@arm.com>
diff --git a/src/ffa_memory.c b/src/ffa_memory.c
index 4d0b084..ac54502 100644
--- a/src/ffa_memory.c
+++ b/src/ffa_memory.c
@@ -3791,7 +3791,8 @@
return ffa_error(FFA_INVALID_PARAMETERS);
}
- if (relinquish_request->endpoints[0] != from_locked.vm->id) {
+ if (vm_id_is_current_world(from_locked.vm->id) &&
+ relinquish_request->endpoints[0] != from_locked.vm->id) {
dlog_verbose(
"VM ID %d in relinquish message doesn't match "
"calling VM ID %d.\n",
@@ -3823,7 +3824,7 @@
CHECK(memory_region != NULL);
receiver_index = ffa_memory_region_get_receiver_index(
- memory_region, from_locked.vm->id);
+ memory_region, relinquish_request->endpoints[0]);
if (receiver_index == memory_region->receiver_count) {
dlog_verbose(