feat(memory share): enable NWd to SWd device memory lending
Now that NWd device memory is tracked in the other world vm
we can allow device memory to be lent from the normal world
to the secure world.
Signed-off-by: Daniel Boulby <daniel.boulby@arm.com>
Change-Id: I9bfbefc9daedcbbad7f576869763d3d57290db9f
diff --git a/src/ffa_memory.c b/src/ffa_memory.c
index 5169c57..e8e9bdb 100644
--- a/src/ffa_memory.c
+++ b/src/ffa_memory.c
@@ -719,16 +719,12 @@
return ret;
}
- /*
- * Device memory regions can only be lent from SP to SP and to a single
- * borrower.
- */
+ /* Device memory regions can only be lent a single borrower. */
if ((*orig_from_mode & MM_MODE_D) != 0U &&
- !(share_func == FFA_MEM_LEND_32 && !ffa_is_vm_id(from.vm->id) &&
- receivers_count == 1)) {
+ !(share_func == FFA_MEM_LEND_32 && receivers_count == 1)) {
dlog_verbose(
- "Device memory can only be lent, from the secure world "
- "and to a single borrower (mode is %#x).\n",
+ "Device memory can only be lent to a single borrower "
+ "(mode is %#x).\n",
*orig_from_mode);
return ffa_error(FFA_DENIED);
}