feat: helper to reset and free partition notification bindings
The helper utility `vm_reset_notifications` added in this patch is
needed when partition manager reclaims resources from an aborted
partition.
The `ffa_vm_free_resources` function is extended to accept a new
parameter that tracks the associated memory page pool. This facilitates
any memory released by partition manager to be reallocated to the said
page pool.
Moreover, the function `ffa_vm_destroy` has been renamed to
`ffa_vm_nwd_free` for better clarity. And, the function
`ffa_vm_nwd_create` has been renamed to `ffa_vm_nwd_alloc`.
Change-Id: I868bef6bdbbde468f2bf2ce5597a55c6ae95d777
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
diff --git a/src/api.c b/src/api.c
index 3bc2f9c..3ba1993 100644
--- a/src/api.c
+++ b/src/api.c
@@ -98,6 +98,11 @@
mpool_init_from(&api_page_pool, ppool);
}
+struct mpool *api_get_ppool(void)
+{
+ return &api_page_pool;
+}
+
/**
* Get target VM vCPU:
* If VM is UP then return first vCPU.
@@ -1992,7 +1997,7 @@
vm->mailbox.send = NULL;
vm->mailbox.recv = NULL;
- ffa_vm_destroy(vm_locked);
+ ffa_vm_nwd_free(vm_locked);
/* Forward buffer unmapping to SPMC if coming from a VM. */
ffa_setup_rxtx_unmap_forward(vm_locked);