feat: VM created/destroyed partition properties

Report an SP's subscription to VM created/VM destroyed availability
messages from `FFA_PARTITION_INFO_GET` calls from the normal world.

Change-Id: Ibbc000e0d8260251e39deee975dc62bf0ee53899
Signed-off-by: Karl Meakin <karl.meakin@arm.com>
diff --git a/src/api.c b/src/api.c
index ed7f772..0803a3d 100644
--- a/src/api.c
+++ b/src/api.c
@@ -490,6 +490,19 @@
 		properties |= vm->messaging_method & FFA_PARTITION_INDIRECT_MSG;
 	}
 
+	/*
+	 * Only populate on calls from normal world,
+	 * and if SP supports receiving direct message requests.
+	 */
+	if (ffa_is_vm_id(caller_id) &&
+	    (properties & FFA_PARTITION_DIRECT_REQ_RECV) != 0) {
+		if (vm->vm_availability_messages.vm_created) {
+			properties |= FFA_PARTITION_VM_CREATED;
+		}
+		if (vm->vm_availability_messages.vm_destroyed) {
+			properties |= FFA_PARTITION_VM_DESTROYED;
+		}
+	}
 	return properties;
 }