feat(memory share): retrieve request from NWd
If the SPMC is allocator of a given memory handle, it is
expected to keep track of the on going memory region operations.
In the case a VM is retrieving a memory region that is shared with
an SP, it might attempt to retrieve the memory.
The hypervisor issues a retrieve req for the SPMC to pass it
the recorded memory region descriptor, such that it can
validate the retrieve request from the VM and then
update the VM's S2 memory mapping.
The SPMC doesn't expect to receive a request whose memory handle
was allocated by the hypervisor. Return FFA_INVALID_PARAMETERS
in such case.
Change-Id: Id86069cfb263c6a2efc4202ad9e3c5e53cdf1e65
Signed-off-by: J-Alves <joao.alves@arm.com>
diff --git a/inc/hf/ffa_memory_internal.h b/inc/hf/ffa_memory_internal.h
index 2da68f1..be5897d 100644
--- a/inc/hf/ffa_memory_internal.h
+++ b/inc/hf/ffa_memory_internal.h
@@ -146,3 +146,11 @@
struct ffa_memory_region_constituent **fragments,
uint32_t *fragment_constituent_counts, uint32_t fragment_count,
uint32_t memory_to_attributes, uint32_t *to_mode);
+uint32_t ffa_memory_region_get_receiver(struct ffa_memory_region *memory_region,
+ ffa_vm_id_t receiver);
+struct ffa_value ffa_retrieve_check_update(
+ struct vm_locked to_locked, ffa_vm_id_t from_id,
+ struct ffa_memory_region_constituent **fragments,
+ uint32_t *fragment_constituent_counts, uint32_t fragment_count,
+ uint32_t memory_to_attributes, uint32_t share_func, bool clear,
+ struct mpool *page_pool);