feat(notifications): bind and unbind

Handle bind and unbind interfaces. The bind interface is intended for a
given receiver to enable a sender to set the specified notifications.
The unbind interface revokes the sender's ability to set the specified
notifications.
Bindings are tracked per notification in the receiver's vm structure.
This patch adds handling to FFA_NOTIFICATION_BIND and
FFA_NOTIFICATION_UNBIND, functions to validate the bindings,
as well as to make any bindings updates.

Change-Id: I7c70fe4e1285d6f58738d0229568666ce2075d12
Signed-off-by: J-Alves <joao.alves@arm.com>
diff --git a/inc/hf/arch/plat/ffa.h b/inc/hf/arch/plat/ffa.h
index 57ce170..a1eea5f 100644
--- a/inc/hf/arch/plat/ffa.h
+++ b/inc/hf/arch/plat/ffa.h
@@ -10,6 +10,7 @@
 
 #include "hf/ffa.h"
 #include "hf/vcpu.h"
+#include "hf/vm.h"
 
 /** Returns the SPMC ID. */
 struct ffa_value plat_ffa_spmc_id_get(void);
@@ -27,6 +28,11 @@
 				     struct ffa_value *ret);
 bool plat_ffa_is_notifications_create_valid(struct vcpu *current,
 					    ffa_vm_id_t vm_id);
+
+bool plat_ffa_is_notifications_bind_valid(struct vcpu *current,
+					  ffa_vm_id_t sender_id,
+					  ffa_vm_id_t receiver_id);
+
 /**
  * Checks whether managed exit is supported by given SP.
  */
@@ -70,3 +76,14 @@
  * Destroys the notifications bitmap for the given VM ID.
  */
 struct ffa_value plat_ffa_notifications_bitmap_destroy(ffa_vm_id_t vm_id);
+
+/**
+ * Helper to get the struct notifications, depending on the sender's id.
+ */
+struct notifications *plat_ffa_vm_get_notifications_senders_world(
+	struct vm_locked vm_locked, ffa_vm_id_t sender_id);
+
+/**
+ * Helper to check if FF-A ID is a VM ID.
+ */
+bool plat_ffa_is_vm_id(ffa_vm_id_t vm_id);