FF-A: implement direct messaging interface

Implement direct messaging ABI for message passing (PSA FF-A EAC spec
sections 4.4, 10.2, 10.3).
In this implementation only the primary VM is allowed to send direct
message requests to secondary VMs. Only secondary VMs are allowed to
reply with direct message responses. When a direct message request is
being serviced, a secondary VM is not allowed to call other FF-A ABIs
that may result in a vCPU switch (e.g. yield, indirect messaging).
A new vCPU field is introduced indicating if a direct message request is
on-going for the corresponding VM.
Per PSA FF-A v1.0, secondary VMs implement the same number of vCPUs as
the number of PEs. A direct message request arrives on the same vCPU
index as the originating vCPU index which emitted the request.
A direct message request sent from the primary VM or a direct message
response sent from a secondary VM blocks the corresponding vCPU.

Change-Id: Iae6f76d82e91253b6685b3d5fe0d087d3cf7e242
Signed-off-by: Jose Marinho <jose.marinho@arm.com>
Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
diff --git a/src/arch/aarch64/hypervisor/handler.c b/src/arch/aarch64/hypervisor/handler.c
index aac5303..6c01356 100644
--- a/src/arch/aarch64/hypervisor/handler.c
+++ b/src/arch/aarch64/hypervisor/handler.c
@@ -350,11 +350,7 @@
 					 current(), next);
 		return true;
 	case FFA_YIELD_32:
-		api_yield(current(), next);
-
-		/* FFA_YIELD always returns FFA_SUCCESS. */
-		*args = (struct ffa_value){.func = FFA_SUCCESS_32};
-
+		*args = api_yield(current(), next);
 		return true;
 	case FFA_MSG_SEND_32:
 		*args = api_ffa_msg_send(
@@ -402,6 +398,16 @@
 					    (args->arg4 >> 16) & 0xffff,
 					    current());
 		return true;
+	case FFA_MSG_SEND_DIRECT_REQ_32:
+		*args = api_ffa_msg_send_direct_req(
+			ffa_msg_send_sender(*args),
+			ffa_msg_send_receiver(*args), *args, current(), next);
+		return true;
+	case FFA_MSG_SEND_DIRECT_RESP_32:
+		*args = api_ffa_msg_send_direct_resp(
+			ffa_msg_send_sender(*args),
+			ffa_msg_send_receiver(*args), *args, current(), next);
+		return true;
 	}
 
 	return false;