feat(ff-a): Implement FFA_RXTX_UNMAP
Unmap the buffer pair allocated by the callee. For now the Hypervisor
does not forward the unmap call to the SPM as this is not currently
supported by the FFA_RXTX_MAP ABI. The assumption has been made that
since the buffers were mapped in the page tables during FFA_RXTX_MAP
we can safely remap the memory region to be owned and exclusive to the
component without failure.
Signed-off-by: Daniel Boulby <daniel.boulby@arm.com>
Change-Id: Ida1135663953e64dc378f10ce00310499fc7ed43
diff --git a/inc/hf/api.h b/inc/hf/api.h
index 2714735..7543ac3 100644
--- a/inc/hf/api.h
+++ b/inc/hf/api.h
@@ -51,6 +51,8 @@
struct ffa_value api_ffa_rxtx_map(ipaddr_t send, ipaddr_t recv,
uint32_t page_count, struct vcpu *current,
struct vcpu **next);
+struct ffa_value api_ffa_rxtx_unmap(ffa_vm_id_t allocator_id,
+ struct vcpu *current);
struct ffa_value api_yield(struct vcpu *current, struct vcpu **next);
struct ffa_value api_ffa_version(uint32_t requested_version);
struct ffa_value api_ffa_partition_info_get(struct vcpu *current,
diff --git a/inc/vmapi/hf/call.h b/inc/vmapi/hf/call.h
index b8a07da..35e2af4 100644
--- a/inc/vmapi/hf/call.h
+++ b/inc/vmapi/hf/call.h
@@ -104,6 +104,21 @@
}
/**
+ * Unmaps the RX/TX buffer pair of an endpoint or Hypervisor from the
+ * translation regime of the callee.
+ *
+ * Returns:
+ * - FFA_ERROR FFA_INVALID_PARAMETERS if there is no buffer pair registered on
+ * behalf of the caller.
+ * - FFA_SUCCESS on success if no further action is needed.
+ */
+static inline struct ffa_value ffa_rxtx_unmap(void)
+{
+ /* Note that allocator ID MBZ at virtual instance. */
+ return ffa_call((struct ffa_value){.func = FFA_RXTX_UNMAP_32});
+}
+
+/**
* Copies data from the sender's send buffer to the recipient's receive buffer.
*
* If the recipient's receive buffer is busy, it can optionally register the