Add 64 bit direct message handling to libsp

* Change direct message struct to allow 64 bit arguments
* Add 64 bit direct message req/resp functions to FF-A layer
* Distinguish 32/64 bit messages on SP layer by field in sp_msg
* Update tests and mocks

The FF-A direct message response must match the request's 32/64bit mode
which is the responsibility of the callee and it should be validated by
the SPMC.

Signed-off-by: Imre Kis <imre.kis@arm.com>
Change-Id: Ibbd64ca0291dfe142a23471a649a07ba1a036824
diff --git a/components/messaging/ffa/libsp/ffa.c b/components/messaging/ffa/libsp/ffa.c
index 374e940..caacc79 100644
--- a/components/messaging/ffa/libsp/ffa.c
+++ b/components/messaging/ffa/libsp/ffa.c
@@ -33,11 +33,20 @@
 	msg->function_id = svc_result->a0;
 	msg->source_id = (svc_result->a1 >> 16);
 	msg->destination_id = svc_result->a1;
-	msg->args[0] = svc_result->a3;
-	msg->args[1] = svc_result->a4;
-	msg->args[2] = svc_result->a5;
-	msg->args[3] = svc_result->a6;
-	msg->args[4] = svc_result->a7;
+
+	if (FFA_IS_32_BIT_FUNC(msg->function_id)) {
+		msg->args.args32[0] = svc_result->a3;
+		msg->args.args32[1] = svc_result->a4;
+		msg->args.args32[2] = svc_result->a5;
+		msg->args.args32[3] = svc_result->a6;
+		msg->args.args32[4] = svc_result->a7;
+	} else {
+		msg->args.args64[0] = svc_result->a3;
+		msg->args.args64[1] = svc_result->a4;
+		msg->args.args64[2] = svc_result->a5;
+		msg->args.args64[3] = svc_result->a6;
+		msg->args.args64[4] = svc_result->a7;
+	}
 }
 
 /*
@@ -217,7 +226,7 @@
 
 	if (result.a0 == FFA_ERROR) {
 		return ffa_get_errorcode(&result);
-	} else if (result.a0 == FFA_MSG_SEND_DIRECT_REQ_32) {
+	} else if (FFA_TO_32_BIT_FUNC(result.a0) == FFA_MSG_SEND_DIRECT_REQ_32) {
 		ffa_unpack_direct_msg(&result, msg);
 	} else {
 		assert(result.a0 == FFA_SUCCESS_32);
@@ -227,13 +236,15 @@
 	return FFA_OK;
 }
 
-ffa_result ffa_msg_send_direct_req(uint16_t source, uint16_t dest, uint32_t a0,
-				   uint32_t a1, uint32_t a2, uint32_t a3,
-				   uint32_t a4, struct ffa_direct_msg *msg)
+static ffa_result ffa_msg_send_direct_req(uint32_t function_id, uint32_t resp_id,
+					  uint16_t source, uint16_t dest,
+					  uint64_t a0, uint64_t a1, uint64_t a2,
+					  uint64_t a3, uint64_t a4,
+					  struct ffa_direct_msg *msg)
 {
 	struct ffa_params result = {0};
 
-	ffa_svc(FFA_MSG_SEND_DIRECT_REQ_32,
+	ffa_svc(function_id,
 		SHIFT_U32(source, FFA_MSG_SEND_DIRECT_REQ_SOURCE_ID_SHIFT) |
 		dest, FFA_PARAM_MBZ, a0, a1, a2, a3, a4, &result);
 
@@ -244,7 +255,7 @@
 
 	if (result.a0 == FFA_ERROR) {
 		return ffa_get_errorcode(&result);
-	} else if (result.a0 == FFA_MSG_SEND_DIRECT_RESP_32) {
+	} else if (result.a0 == resp_id) {
 		ffa_unpack_direct_msg(&result, msg);
 	} else {
 		assert(result.a0 == FFA_SUCCESS_32);
@@ -254,13 +265,36 @@
 	return FFA_OK;
 }
 
-ffa_result ffa_msg_send_direct_resp(uint16_t source, uint16_t dest, uint32_t a0,
-				    uint32_t a1, uint32_t a2, uint32_t a3,
-				    uint32_t a4, struct ffa_direct_msg *msg)
+ffa_result ffa_msg_send_direct_req_32(uint16_t source, uint16_t dest,
+				      uint32_t a0, uint32_t a1, uint32_t a2,
+				      uint32_t a3, uint32_t a4,
+				      struct ffa_direct_msg *msg)
+{
+	return ffa_msg_send_direct_req(FFA_MSG_SEND_DIRECT_REQ_32,
+				       FFA_MSG_SEND_DIRECT_RESP_32,
+				       source, dest, a0, a1, a2, a3, a4, msg);
+}
+
+ffa_result ffa_msg_send_direct_req_64(uint16_t source, uint16_t dest,
+				      uint64_t a0, uint64_t a1, uint64_t a2,
+				      uint64_t a3, uint64_t a4,
+				      struct ffa_direct_msg *msg)
+{
+	return ffa_msg_send_direct_req(FFA_MSG_SEND_DIRECT_REQ_64,
+				       FFA_MSG_SEND_DIRECT_RESP_64,
+				       source, dest, a0, a1, a2, a3, a4, msg);
+}
+
+static ffa_result ffa_msg_send_direct_resp(uint32_t function_id,
+					   uint16_t source, uint16_t dest,
+					   uint64_t a0, uint64_t a1,
+					   uint64_t a2, uint64_t a3,
+					   uint64_t a4,
+					   struct ffa_direct_msg *msg)
 {
 	struct ffa_params result = {0};
 
-	ffa_svc(FFA_MSG_SEND_DIRECT_RESP_32,
+	ffa_svc(function_id,
 		SHIFT_U32(source, FFA_MSG_SEND_DIRECT_RESP_SOURCE_ID_SHIFT) |
 		dest, FFA_PARAM_MBZ, a0, a1, a2, a3, a4, &result);
 
@@ -271,7 +305,7 @@
 
 	if (result.a0 == FFA_ERROR) {
 		return ffa_get_errorcode(&result);
-	} else if (result.a0 == FFA_MSG_SEND_DIRECT_REQ_32) {
+	} else if (FFA_TO_32_BIT_FUNC(result.a0) == FFA_MSG_SEND_DIRECT_REQ_32) {
 		ffa_unpack_direct_msg(&result, msg);
 	} else {
 		assert(result.a0 == FFA_SUCCESS_32);
@@ -281,6 +315,24 @@
 	return FFA_OK;
 }
 
+ffa_result ffa_msg_send_direct_resp_32(uint16_t source, uint16_t dest,
+				       uint32_t a0, uint32_t a1, uint32_t a2,
+				       uint32_t a3, uint32_t a4,
+				       struct ffa_direct_msg *msg)
+{
+	return ffa_msg_send_direct_resp(FFA_MSG_SEND_DIRECT_RESP_32, source,
+					dest, a0, a1, a2, a3, a4, msg);
+}
+
+ffa_result ffa_msg_send_direct_resp_64(uint16_t source, uint16_t dest,
+				      uint64_t a0, uint64_t a1, uint64_t a2,
+				      uint64_t a3, uint64_t a4,
+				      struct ffa_direct_msg *msg)
+{
+	return ffa_msg_send_direct_resp(FFA_MSG_SEND_DIRECT_RESP_64, source,
+					dest, a0, a1, a2, a3, a4, msg);
+}
+
 ffa_result ffa_mem_donate(uint32_t total_length, uint32_t fragment_length,
 			  void *buffer_address, uint32_t page_count,
 			  uint64_t *handle)
diff --git a/components/messaging/ffa/libsp/ffa_direct_msg_routing_extension.c b/components/messaging/ffa/libsp/ffa_direct_msg_routing_extension.c
index 6813573..03a372f 100644
--- a/components/messaging/ffa/libsp/ffa_direct_msg_routing_extension.c
+++ b/components/messaging/ffa/libsp/ffa_direct_msg_routing_extension.c
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: BSD-3-Clause
 /*
- * Copyright (c) 2020-2021, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2020-2022, Arm Limited and Contributors. All rights reserved.
  */
 
 #include "ffa_direct_msg_routing_extension.h"
@@ -20,23 +20,23 @@
 
 static bool is_rc_message(const struct ffa_direct_msg *msg)
 {
-	return msg->args[0] & FFA_ROUTING_EXT_RC_BIT;
+	return msg->args.args32[0] & FFA_ROUTING_EXT_RC_BIT;
 }
 
 static bool is_error_message(const struct ffa_direct_msg *msg)
 {
-	return msg->args[0] & FFA_ROUTING_EXT_ERROR_BIT;
+	return msg->args.args32[0] & FFA_ROUTING_EXT_ERROR_BIT;
 }
 
 static ffa_result get_error_code_from_message(const struct ffa_direct_msg *msg)
 {
-	return (ffa_result)msg->args[1];
+	return (ffa_result)msg->args.args32[1];
 }
 
 static ffa_result send_rc_error_message(struct ffa_direct_msg *req,
 					ffa_result error_code)
 {
-	return ffa_msg_send_direct_resp(req->destination_id, req->source_id,
+	return ffa_msg_send_direct_resp_32(req->destination_id, req->source_id,
 					(FFA_ROUTING_EXT_ERROR_BIT |
 					 FFA_ROUTING_EXT_RC_BIT),
 					error_code, 0, 0, 0, req);
@@ -45,7 +45,7 @@
 static ffa_result send_rc_error_message_to_rc_root(struct ffa_direct_msg *resp,
 						   ffa_result error_code)
 {
-	return ffa_msg_send_direct_req(own_id, callee_id,
+	return ffa_msg_send_direct_req_32(own_id, callee_id,
 				       (FFA_ROUTING_EXT_RC_BIT |
 					FFA_ROUTING_EXT_ERROR_BIT),
 				       error_code, 0, 0, 0, resp);
@@ -128,10 +128,10 @@
 		/* Forwarding RC request towards the root (normal world) */
 		state = forwarding;
 
-		ffa_res = ffa_msg_send_direct_resp(own_id, caller_id,
-						   resp->args[0], resp->args[1],
-						   resp->args[2], resp->args[3],
-						   resp->args[4], &rc_resp);
+		ffa_res = ffa_msg_send_direct_resp_32(own_id, caller_id,
+						   resp->args.args32[0], resp->args.args32[1],
+						   resp->args.args32[2], resp->args.args32[3],
+						   resp->args.args32[4], &rc_resp);
 		if (ffa_res != FFA_OK)
 			goto forward_ffa_error_to_rc_root;
 
@@ -145,9 +145,9 @@
 
 		/* Forwarding RC response towards the RC root. */
 		state = internal;
-		ffa_res = ffa_msg_send_direct_req(
-			own_id, callee_id, rc_resp.args[0], rc_resp.args[1],
-			rc_resp.args[2], rc_resp.args[3], rc_resp.args[4],
+		ffa_res = ffa_msg_send_direct_req_32(
+			own_id, callee_id, rc_resp.args.args32[0], rc_resp.args.args32[1],
+			rc_resp.args.args32[2], rc_resp.args.args32[3], rc_resp.args.args32[4],
 			resp);
 
 		goto break_on_ffa_error;
@@ -197,7 +197,7 @@
 
 void ffa_direct_msg_routing_ext_rc_req_pre_hook(struct ffa_direct_msg *req)
 {
-	req->args[0] = FFA_ROUTING_EXT_RC_BIT;
+	req->args.args32[0] = FFA_ROUTING_EXT_RC_BIT;
 	state = rc_root;
 }
 
diff --git a/components/messaging/ffa/libsp/include/ffa_api.h b/components/messaging/ffa/libsp/include/ffa_api.h
index ec5cb04..4b7073b 100644
--- a/components/messaging/ffa/libsp/include/ffa_api.h
+++ b/components/messaging/ffa/libsp/include/ffa_api.h
@@ -126,8 +126,8 @@
 /** Messaging interfaces */
 
 /**
- * @brief      Sends a partition message in parameter registers as a request and
- *             blocks until the response is available.
+ * @brief      Sends a 32 bit partition message in parameter registers as a
+ *             request and blocks until the response is available.
  * @note       The ffa_interrupt_handler function can be called during the
  *             execution of this function
  *
@@ -138,13 +138,14 @@
  *
  * @return     The FF-A error status code
  */
-ffa_result ffa_msg_send_direct_req(uint16_t source, uint16_t dest, uint32_t a0,
-				   uint32_t a1, uint32_t a2, uint32_t a3,
-				   uint32_t a4, struct ffa_direct_msg *msg);
+ffa_result ffa_msg_send_direct_req_32(uint16_t source, uint16_t dest,
+				      uint32_t a0, uint32_t a1, uint32_t a2,
+				      uint32_t a3, uint32_t a4,
+				      struct ffa_direct_msg *msg);
 
 /**
- * @brief      Sends a partition message in parameter registers as a response
- *             and blocks until the response is available.
+ * @brief      Sends a 64 bit partition message in parameter registers as a
+ *             request and blocks until the response is available.
  * @note       The ffa_interrupt_handler function can be called during the
  *             execution of this function
  *
@@ -155,9 +156,46 @@
  *
  * @return     The FF-A error status code
  */
-ffa_result ffa_msg_send_direct_resp(uint16_t source, uint16_t dest, uint32_t a0,
-				    uint32_t a1, uint32_t a2, uint32_t a3,
-				    uint32_t a4, struct ffa_direct_msg *msg);
+ffa_result ffa_msg_send_direct_req_64(uint16_t source, uint16_t dest,
+				      uint64_t a0, uint64_t a1, uint64_t a2,
+				      uint64_t a3, uint64_t a4,
+				      struct ffa_direct_msg *msg);
+
+/**
+ * @brief      Sends a 32 bit partition message in parameter registers as a
+ *             response and blocks until the response is available.
+ * @note       The ffa_interrupt_handler function can be called during the
+ *             execution of this function
+ *
+ * @param[in]  source            Source endpoint ID
+ * @param[in]  dest              Destination endpoint ID
+ * @param[in]  a0,a1,a2,a3,a4    Implementation defined message values
+ * @param[out] msg               The response message
+ *
+ * @return     The FF-A error status code
+ */
+ffa_result ffa_msg_send_direct_resp_32(uint16_t source, uint16_t dest,
+				       uint32_t a0, uint32_t a1, uint32_t a2,
+				       uint32_t a3, uint32_t a4,
+				       struct ffa_direct_msg *msg);
+
+/**
+ * @brief      Sends a 64 bit partition message in parameter registers as a
+ *             response and blocks until the response is available.
+ * @note       The ffa_interrupt_handler function can be called during the
+ *             execution of this function
+ *
+ * @param[in]  source            Source endpoint ID
+ * @param[in]  dest              Destination endpoint ID
+ * @param[in]  a0,a1,a2,a3,a4    Implementation defined message values
+ * @param[out] msg               The response message
+ *
+ * @return     The FF-A error status code
+ */
+ffa_result ffa_msg_send_direct_resp_64(uint16_t source, uint16_t dest,
+				       uint64_t a0, uint64_t a1, uint64_t a2,
+				       uint64_t a3, uint64_t a4,
+				       struct ffa_direct_msg *msg);
 
 /**
  * Memory management interfaces
diff --git a/components/messaging/ffa/libsp/include/ffa_api_defines.h b/components/messaging/ffa/libsp/include/ffa_api_defines.h
index 95bcb0c..163a0cd 100644
--- a/components/messaging/ffa/libsp/include/ffa_api_defines.h
+++ b/components/messaging/ffa/libsp/include/ffa_api_defines.h
@@ -58,6 +58,11 @@
 #define FFA_MEM_PERM_GET		UINT32_C(0x84000088)
 #define FFA_MEM_PERM_SET		UINT32_C(0x84000089)
 
+/* Utility macros */
+#define FFA_TO_32_BIT_FUNC(x)		((x) & (~UINT32_C(0x40000000)))
+#define FFA_IS_32_BIT_FUNC(x)		(((x) & UINT32_C(0x40000000)) == 0)
+#define FFA_IS_64_BIT_FUNC(x)		(((x) & UINT32_C(0x40000000)) != 0)
+
 /* Special value for MBZ parameters */
 #define FFA_PARAM_MBZ			UINT32_C(0x0)
 
diff --git a/components/messaging/ffa/libsp/include/ffa_api_types.h b/components/messaging/ffa/libsp/include/ffa_api_types.h
index 3686e2e..b1be7ac 100644
--- a/components/messaging/ffa/libsp/include/ffa_api_types.h
+++ b/components/messaging/ffa/libsp/include/ffa_api_types.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: BSD-3-Clause */
 /*
- * Copyright (c) 2020, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2020-2022, Arm Limited and Contributors. All rights reserved.
  */
 
 #ifndef LIBSP_INCLUDE_FFA_API_TYPES_H_
@@ -80,7 +80,10 @@
 	uint32_t function_id;
 	uint16_t source_id;
 	uint16_t destination_id;
-	uint32_t args[5];
+	union {
+		uint32_t args32[5];
+		uint64_t args64[5];
+	} args;
 };
 
 /**
diff --git a/components/messaging/ffa/libsp/include/sp_messaging.h b/components/messaging/ffa/libsp/include/sp_messaging.h
index 4bb45f7..7173a92 100644
--- a/components/messaging/ffa/libsp/include/sp_messaging.h
+++ b/components/messaging/ffa/libsp/include/sp_messaging.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: BSD-3-Clause */
 /*
- * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
  */
 
 #ifndef LIBSP_INCLUDE_SP_MESSAGING_H_
@@ -9,6 +9,7 @@
 #include "sp_api_defines.h"
 #include "sp_api_types.h"
 
+#include <stdbool.h>
 #include <stdint.h>
 
 #ifdef __cplusplus
@@ -23,7 +24,11 @@
 struct sp_msg {
 	uint16_t source_id;
 	uint16_t destination_id;
-	uint32_t args[SP_MSG_ARG_COUNT];
+	bool is_64bit_message;
+	union {
+		uint32_t args32[SP_MSG_ARG_COUNT];
+		uint64_t args64[SP_MSG_ARG_COUNT];
+	} args;
 };
 
 /**
diff --git a/components/messaging/ffa/libsp/mock/mock_ffa_api.cpp b/components/messaging/ffa/libsp/mock/mock_ffa_api.cpp
index ceebcbf..a01848c 100644
--- a/components/messaging/ffa/libsp/mock/mock_ffa_api.cpp
+++ b/components/messaging/ffa/libsp/mock/mock_ffa_api.cpp
@@ -140,13 +140,13 @@
 		.returnIntValue();
 }
 
-void expect_ffa_msg_send_direct_req(uint16_t source, uint16_t dest, uint32_t a0,
-				    uint32_t a1, uint32_t a2, uint32_t a3,
-				    uint32_t a4,
-				    const struct ffa_direct_msg *msg,
-				    ffa_result result)
+void expect_ffa_msg_send_direct_req_32(uint16_t source, uint16_t dest,
+				       uint32_t a0, uint32_t a1, uint32_t a2,
+				       uint32_t a3, uint32_t a4,
+				       const struct ffa_direct_msg *msg,
+				       ffa_result result)
 {
-	mock().expectOneCall("ffa_msg_send_direct_req")
+	mock().expectOneCall("ffa_msg_send_direct_req_32")
 		.withUnsignedIntParameter("source", source)
 		.withUnsignedIntParameter("dest", dest)
 		.withUnsignedIntParameter("a0", a0)
@@ -158,12 +158,13 @@
 		.andReturnValue(result);
 }
 
-ffa_result ffa_msg_send_direct_req(uint16_t source, uint16_t dest, uint32_t a0,
-				   uint32_t a1, uint32_t a2, uint32_t a3,
-				   uint32_t a4, struct ffa_direct_msg *msg)
+ffa_result ffa_msg_send_direct_req_32(uint16_t source, uint16_t dest,
+				      uint32_t a0, uint32_t a1, uint32_t a2,
+				      uint32_t a3,uint32_t a4,
+				      struct ffa_direct_msg *msg)
 {
 	return mock()
-		.actualCall("ffa_msg_send_direct_req")
+		.actualCall("ffa_msg_send_direct_req_32")
 		.withUnsignedIntParameter("source", source)
 		.withUnsignedIntParameter("dest", dest)
 		.withUnsignedIntParameter("a0", a0)
@@ -175,13 +176,49 @@
 		.returnIntValue();
 }
 
-void expect_ffa_msg_send_direct_resp(uint16_t source, uint16_t dest,
+void expect_ffa_msg_send_direct_req_64(uint16_t source, uint16_t dest,
+				       uint64_t a0, uint64_t a1, uint64_t a2,
+				       uint64_t a3, uint64_t a4,
+				       const struct ffa_direct_msg *msg,
+				       ffa_result result)
+{
+	mock().expectOneCall("ffa_msg_send_direct_req_64")
+		.withUnsignedIntParameter("source", source)
+		.withUnsignedIntParameter("dest", dest)
+		.withUnsignedLongIntParameter("a0", a0)
+		.withUnsignedLongIntParameter("a1", a1)
+		.withUnsignedLongIntParameter("a2", a2)
+		.withUnsignedLongIntParameter("a3", a3)
+		.withUnsignedLongIntParameter("a4", a4)
+		.withOutputParameterReturning("msg", msg, sizeof(*msg))
+		.andReturnValue(result);
+}
+
+ffa_result ffa_msg_send_direct_req_64(uint16_t source, uint16_t dest,
+				      uint64_t a0, uint64_t a1, uint64_t a2,
+				      uint64_t a3, uint64_t a4,
+				      struct ffa_direct_msg *msg)
+{
+	return mock()
+		.actualCall("ffa_msg_send_direct_req_64")
+		.withUnsignedIntParameter("source", source)
+		.withUnsignedIntParameter("dest", dest)
+		.withUnsignedLongIntParameter("a0", a0)
+		.withUnsignedLongIntParameter("a1", a1)
+		.withUnsignedLongIntParameter("a2", a2)
+		.withUnsignedLongIntParameter("a3", a3)
+		.withUnsignedLongIntParameter("a4", a4)
+		.withOutputParameter("msg", msg)
+		.returnIntValue();
+}
+
+void expect_ffa_msg_send_direct_resp_32(uint16_t source, uint16_t dest,
 				     uint32_t a0, uint32_t a1, uint32_t a2,
 				     uint32_t a3, uint32_t a4,
 				     const struct ffa_direct_msg *msg,
 				     ffa_result result)
 {
-	mock().expectOneCall("ffa_msg_send_direct_resp")
+	mock().expectOneCall("ffa_msg_send_direct_resp_32")
 		.withUnsignedIntParameter("source", source)
 		.withUnsignedIntParameter("dest", dest)
 		.withUnsignedIntParameter("a0", a0)
@@ -193,12 +230,12 @@
 		.andReturnValue(result);
 }
 
-ffa_result ffa_msg_send_direct_resp(uint16_t source, uint16_t dest, uint32_t a0,
+ffa_result ffa_msg_send_direct_resp_32(uint16_t source, uint16_t dest, uint32_t a0,
 				    uint32_t a1, uint32_t a2, uint32_t a3,
 				    uint32_t a4, struct ffa_direct_msg *msg)
 {
 	return mock()
-		.actualCall("ffa_msg_send_direct_resp")
+		.actualCall("ffa_msg_send_direct_resp_32")
 		.withUnsignedIntParameter("source", source)
 		.withUnsignedIntParameter("dest", dest)
 		.withUnsignedIntParameter("a0", a0)
@@ -210,6 +247,41 @@
 		.returnIntValue();
 }
 
+void expect_ffa_msg_send_direct_resp_64(uint16_t source, uint16_t dest,
+				     uint64_t a0, uint64_t a1, uint64_t a2,
+				     uint64_t a3, uint64_t a4,
+				     const struct ffa_direct_msg *msg,
+				     ffa_result result)
+{
+	mock().expectOneCall("ffa_msg_send_direct_resp_64")
+		.withUnsignedIntParameter("source", source)
+		.withUnsignedIntParameter("dest", dest)
+		.withUnsignedLongIntParameter("a0", a0)
+		.withUnsignedLongIntParameter("a1", a1)
+		.withUnsignedLongIntParameter("a2", a2)
+		.withUnsignedLongIntParameter("a3", a3)
+		.withUnsignedLongIntParameter("a4", a4)
+		.withOutputParameterReturning("msg", msg, sizeof(*msg))
+		.andReturnValue(result);
+}
+
+ffa_result ffa_msg_send_direct_resp_64(uint16_t source, uint16_t dest, uint64_t a0,
+				    uint64_t a1, uint64_t a2, uint64_t a3,
+				    uint64_t a4, struct ffa_direct_msg *msg)
+{
+	return mock()
+		.actualCall("ffa_msg_send_direct_resp_64")
+		.withUnsignedIntParameter("source", source)
+		.withUnsignedIntParameter("dest", dest)
+		.withUnsignedLongIntParameter("a0", a0)
+		.withUnsignedLongIntParameter("a1", a1)
+		.withUnsignedLongIntParameter("a2", a2)
+		.withUnsignedLongIntParameter("a3", a3)
+		.withUnsignedLongIntParameter("a4", a4)
+		.withOutputParameter("msg", msg)
+		.returnIntValue();
+}
+
 void expect_ffa_mem_donate(uint32_t total_length, uint32_t fragment_length,
 			   void *buffer_address, uint32_t page_count,
 			   const uint64_t *handle, ffa_result result)
diff --git a/components/messaging/ffa/libsp/mock/mock_ffa_api.h b/components/messaging/ffa/libsp/mock/mock_ffa_api.h
index b1c794f..4213ccb 100644
--- a/components/messaging/ffa/libsp/mock/mock_ffa_api.h
+++ b/components/messaging/ffa/libsp/mock/mock_ffa_api.h
@@ -30,17 +30,29 @@
 
 void expect_ffa_msg_wait(const struct ffa_direct_msg *msg, ffa_result result);
 
-void expect_ffa_msg_send_direct_req(uint16_t source, uint16_t dest, uint32_t a0,
-				    uint32_t a1, uint32_t a2, uint32_t a3,
-				    uint32_t a4,
-				    const struct ffa_direct_msg *msg,
-				    ffa_result result);
+void expect_ffa_msg_send_direct_req_32(uint16_t source, uint16_t dest,
+				       uint32_t a0, uint32_t a1, uint32_t a2,
+				       uint32_t a3, uint32_t a4,
+				       const struct ffa_direct_msg *msg,
+				       ffa_result result);
 
-void expect_ffa_msg_send_direct_resp(uint16_t source, uint16_t dest,
-				     uint32_t a0, uint32_t a1, uint32_t a2,
-				     uint32_t a3, uint32_t a4,
-				     const struct ffa_direct_msg *msg,
-				     ffa_result result);
+void expect_ffa_msg_send_direct_req_64(uint16_t source, uint16_t dest,
+				       uint64_t a0, uint64_t a1, uint64_t a2,
+				       uint64_t a3, uint64_t a4,
+				       const struct ffa_direct_msg *msg,
+				       ffa_result result);
+
+void expect_ffa_msg_send_direct_resp_32(uint16_t source, uint16_t dest,
+					uint32_t a0, uint32_t a1, uint32_t a2,
+					uint32_t a3, uint32_t a4,
+					const struct ffa_direct_msg *msg,
+					ffa_result result);
+
+void expect_ffa_msg_send_direct_resp_64(uint16_t source, uint16_t dest,
+					uint64_t a0, uint64_t a1, uint64_t a2,
+					uint64_t a3, uint64_t a4,
+					const struct ffa_direct_msg *msg,
+					ffa_result result);
 
 void expect_ffa_mem_donate(uint32_t total_length, uint32_t fragment_length,
 			   void *buffer_address, uint32_t page_count,
diff --git a/components/messaging/ffa/libsp/mock/test/test_mock_ffa_api.cpp b/components/messaging/ffa/libsp/mock/test/test_mock_ffa_api.cpp
index ab33649..c1cbdd6 100644
--- a/components/messaging/ffa/libsp/mock/test/test_mock_ffa_api.cpp
+++ b/components/messaging/ffa/libsp/mock/test/test_mock_ffa_api.cpp
@@ -105,7 +105,7 @@
 	MEMCMP_EQUAL(&expected_msg, &msg, sizeof(expected_msg));
 }
 
-TEST(mock_ffa_api, ffa_msg_send_direct_req)
+TEST(mock_ffa_api, ffa_msg_send_direct_req_32)
 {
 	const uint16_t source = 0x1122;
 	const uint16_t dest = 0x2233;
@@ -116,13 +116,30 @@
 	const uint32_t a4 = 0x89124567;
 	struct ffa_direct_msg msg = { 0 };
 
-	expect_ffa_msg_send_direct_req(source, dest, a0, a1, a2, a3, a4,
-				       &expected_msg, result);
-	LONGS_EQUAL(result, ffa_msg_send_direct_req(source, dest, a0, a1, a2,
-						    a3, a4, &msg));
+	expect_ffa_msg_send_direct_req_32(source, dest, a0, a1, a2, a3, a4,
+				          &expected_msg, result);
+	LONGS_EQUAL(result, ffa_msg_send_direct_req_32(source, dest, a0, a1, a2,
+						       a3, a4, &msg));
 }
 
-TEST(mock_ffa_api, ffa_msg_send_direct_resp)
+TEST(mock_ffa_api, ffa_msg_send_direct_req_64)
+{
+	const uint16_t source = 0x1122;
+	const uint16_t dest = 0x2233;
+	const uint64_t a0 = 0x4567891221987654;
+	const uint64_t a1 = 0x5678912442198765;
+	const uint64_t a2 = 0x6789124554219876;
+	const uint64_t a3 = 0x7891245665421987;
+	const uint64_t a4 = 0x8912456776542198;
+	struct ffa_direct_msg msg = { 0 };
+
+	expect_ffa_msg_send_direct_req_64(source, dest, a0, a1, a2, a3, a4,
+				       &expected_msg, result);
+	LONGS_EQUAL(result, ffa_msg_send_direct_req_64(source, dest, a0, a1, a2,
+						       a3, a4, &msg));
+}
+
+TEST(mock_ffa_api, ffa_msg_send_direct_resp_32)
 {
 	const uint16_t source = 0x1122;
 	const uint16_t dest = 0x2233;
@@ -133,10 +150,27 @@
 	const uint32_t a4 = 0x89124567;
 	struct ffa_direct_msg msg = { 0 };
 
-	expect_ffa_msg_send_direct_resp(source, dest, a0, a1, a2, a3, a4,
+	expect_ffa_msg_send_direct_resp_32(source, dest, a0, a1, a2, a3, a4,
 					&expected_msg, result);
-	LONGS_EQUAL(result, ffa_msg_send_direct_resp(source, dest, a0, a1, a2,
-						     a3, a4, &msg));
+	LONGS_EQUAL(result, ffa_msg_send_direct_resp_32(source, dest, a0, a1,
+							a2, a3, a4, &msg));
+}
+
+TEST(mock_ffa_api, ffa_msg_send_direct_resp_64)
+{
+	const uint16_t source = 0x1122;
+	const uint16_t dest = 0x2233;
+	const uint64_t a0 = 0x4567891221987654;
+	const uint64_t a1 = 0x5678912442198765;
+	const uint64_t a2 = 0x6789124554219876;
+	const uint64_t a3 = 0x7891245665421987;
+	const uint64_t a4 = 0x8912456776542198;
+	struct ffa_direct_msg msg = { 0 };
+
+	expect_ffa_msg_send_direct_resp_64(source, dest, a0, a1, a2, a3, a4,
+					  &expected_msg, result);
+	LONGS_EQUAL(result, ffa_msg_send_direct_resp_64(source, dest, a0, a1,
+							a2, a3, a4, &msg));
 }
 
 TEST(mock_ffa_api, ffa_mem_donate)
diff --git a/components/messaging/ffa/libsp/sp_messaging.c b/components/messaging/ffa/libsp/sp_messaging.c
index f7223aa..392006b 100644
--- a/components/messaging/ffa/libsp/sp_messaging.c
+++ b/components/messaging/ffa/libsp/sp_messaging.c
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: BSD-3-Clause
 /*
- * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
  */
 
 #include "ffa_api.h"
@@ -20,22 +20,40 @@
 	ffa_msg->source_id = msg->source_id;
 	ffa_msg->destination_id = msg->destination_id;
 
-	ffa_msg->args[0] = 0;
-	memcpy(&ffa_msg->args[SP_MSG_ARG_OFFSET], msg->args, sizeof(msg->args));
+	ffa_msg->args.args64[0] = 0;
+	if (msg->is_64bit_message)
+		memcpy(&ffa_msg->args.args64[SP_MSG_ARG_OFFSET],
+		       msg->args.args64, sizeof(msg->args.args64));
+	else
+		memcpy(&ffa_msg->args.args32[SP_MSG_ARG_OFFSET],
+		       msg->args.args32, sizeof(msg->args.args32));
 }
 
 static void unpack_ffa_direct_msg(const struct ffa_direct_msg *ffa_msg,
 				  struct sp_msg *msg)
 {
-	if (ffa_msg->function_id != FFA_SUCCESS_32) {
+	if (ffa_msg->function_id == FFA_MSG_SEND_DIRECT_REQ_32 ||
+	    ffa_msg->function_id == FFA_MSG_SEND_DIRECT_RESP_32) {
 		/*
-		 * Handling request or response (error is handled before call)
+		 * Handling 32 bit request or response
 		 */
 		msg->source_id = ffa_msg->source_id;
 		msg->destination_id = ffa_msg->destination_id;
+		msg->is_64bit_message = FFA_IS_64_BIT_FUNC(ffa_msg->function_id);
 
-		memcpy(msg->args, &ffa_msg->args[SP_MSG_ARG_OFFSET],
-		       sizeof(msg->args));
+		memcpy(msg->args.args32, &ffa_msg->args.args32[SP_MSG_ARG_OFFSET],
+		       sizeof(msg->args.args32));
+	} else if (ffa_msg->function_id == FFA_MSG_SEND_DIRECT_REQ_64 ||
+		   ffa_msg->function_id == FFA_MSG_SEND_DIRECT_RESP_64) {
+		/*
+		 * Handling 64 bit request or response
+		 */
+		msg->source_id = ffa_msg->source_id;
+		msg->destination_id = ffa_msg->destination_id;
+		msg->is_64bit_message = FFA_IS_64_BIT_FUNC(ffa_msg->function_id);
+
+		memcpy(msg->args.args64, &ffa_msg->args.args64[SP_MSG_ARG_OFFSET],
+		       sizeof(msg->args.args64));
 	} else {
 		/* Success has no message parameters */
 		*msg = (struct sp_msg){ 0 };
@@ -89,11 +107,18 @@
 	ffa_direct_msg_routing_ext_req_pre_hook(&ffa_req);
 #endif
 
-	ffa_res = ffa_msg_send_direct_req(ffa_req.source_id,
-					  ffa_req.destination_id,
-					  ffa_req.args[0], ffa_req.args[1],
-					  ffa_req.args[2], ffa_req.args[3],
-					  ffa_req.args[4], &ffa_resp);
+	if (req->is_64bit_message)
+		ffa_res = ffa_msg_send_direct_req_64(
+			ffa_req.source_id, ffa_req.destination_id,
+			ffa_req.args.args64[0], ffa_req.args.args64[1],
+			ffa_req.args.args64[2], ffa_req.args.args64[3],
+			ffa_req.args.args64[4], &ffa_resp);
+	else
+		ffa_res = ffa_msg_send_direct_req_32(
+			ffa_req.source_id, ffa_req.destination_id,
+			ffa_req.args.args32[0], ffa_req.args.args32[1],
+			ffa_req.args.args32[2], ffa_req.args.args32[3],
+			ffa_req.args.args32[4], &ffa_resp);
 
 	if (ffa_res != FFA_OK) {
 #if FFA_DIRECT_MSG_ROUTING_EXTENSION
@@ -136,11 +161,18 @@
 	ffa_direct_msg_routing_ext_resp_pre_hook(&ffa_resp);
 #endif
 
-	ffa_res = ffa_msg_send_direct_resp(ffa_resp.source_id,
-					   ffa_resp.destination_id,
-					   ffa_resp.args[0], ffa_resp.args[1],
-					   ffa_resp.args[2], ffa_resp.args[3],
-					   ffa_resp.args[4], &ffa_req);
+	if (resp->is_64bit_message)
+		ffa_res = ffa_msg_send_direct_resp_64(
+			ffa_resp.source_id, ffa_resp.destination_id,
+			ffa_resp.args.args64[0], ffa_resp.args.args64[1],
+			ffa_resp.args.args64[2], ffa_resp.args.args64[3],
+			ffa_resp.args.args64[4], &ffa_req);
+	else
+		ffa_res = ffa_msg_send_direct_resp_32(
+			ffa_resp.source_id, ffa_resp.destination_id,
+			ffa_resp.args.args32[0], ffa_resp.args.args32[1],
+			ffa_resp.args.args32[2], ffa_resp.args.args32[3],
+			ffa_resp.args.args32[4], &ffa_req);
 
 	if (ffa_res != FFA_OK) {
 #if FFA_DIRECT_MSG_ROUTING_EXTENSION
@@ -182,11 +214,11 @@
 
 	ffa_direct_msg_routing_ext_rc_req_pre_hook(&ffa_req);
 
-	ffa_res = ffa_msg_send_direct_resp(ffa_req.source_id,
+	ffa_res = ffa_msg_send_direct_resp_32(ffa_req.source_id,
 					   ffa_req.destination_id,
-					   ffa_req.args[0], ffa_req.args[1],
-					   ffa_req.args[2], ffa_req.args[3],
-					   ffa_req.args[4], &ffa_resp);
+					   ffa_req.args.args32[0], ffa_req.args.args32[1],
+					   ffa_req.args.args32[2], ffa_req.args.args32[3],
+					   ffa_req.args.args32[4], &ffa_resp);
 
 	if (ffa_res != FFA_OK) {
 		ffa_direct_msg_routing_ext_rc_req_error_hook();
diff --git a/components/messaging/ffa/libsp/test/test_ffa_api.cpp b/components/messaging/ffa/libsp/test/test_ffa_api.cpp
index 8fa261e..6cca085 100644
--- a/components/messaging/ffa/libsp/test/test_ffa_api.cpp
+++ b/components/messaging/ffa/libsp/test/test_ffa_api.cpp
@@ -43,20 +43,35 @@
 		svc_result.a2 = (uint32_t)error_code;
 	}
 
-	void msg_equal(uint32_t func_id, uint16_t source_id, uint16_t dest_id,
-			uint32_t arg0, uint32_t arg1, uint32_t arg2,
-			uint32_t arg3, uint32_t arg4)
+	void msg_equal_32(uint32_t func_id, uint16_t source_id, uint16_t dest_id,
+			  uint32_t arg0, uint32_t arg1, uint32_t arg2,
+			  uint32_t arg3, uint32_t arg4)
 	{
 		UNSIGNED_LONGS_EQUAL(func_id, msg.function_id);
 		UNSIGNED_LONGS_EQUAL(source_id, msg.source_id);
 		UNSIGNED_LONGS_EQUAL(dest_id, msg.destination_id);
-		UNSIGNED_LONGS_EQUAL(arg0, msg.args[0]);
-		UNSIGNED_LONGS_EQUAL(arg1, msg.args[1]);
-		UNSIGNED_LONGS_EQUAL(arg2, msg.args[2]);
-		UNSIGNED_LONGS_EQUAL(arg3, msg.args[3]);
-		UNSIGNED_LONGS_EQUAL(arg4, msg.args[4]);
+		UNSIGNED_LONGS_EQUAL(arg0, msg.args.args32[0]);
+		UNSIGNED_LONGS_EQUAL(arg1, msg.args.args32[1]);
+		UNSIGNED_LONGS_EQUAL(arg2, msg.args.args32[2]);
+		UNSIGNED_LONGS_EQUAL(arg3, msg.args.args32[3]);
+		UNSIGNED_LONGS_EQUAL(arg4, msg.args.args32[4]);
 	}
 
+	void msg_equal_64(uint32_t func_id, uint16_t source_id, uint16_t dest_id,
+			  uint64_t arg0, uint64_t arg1, uint64_t arg2,
+			  uint64_t arg3, uint64_t arg4)
+	{
+		UNSIGNED_LONGS_EQUAL(func_id, msg.function_id);
+		UNSIGNED_LONGS_EQUAL(source_id, msg.source_id);
+		UNSIGNED_LONGS_EQUAL(dest_id, msg.destination_id);
+		UNSIGNED_LONGLONGS_EQUAL(arg0, msg.args.args64[0]);
+		UNSIGNED_LONGLONGS_EQUAL(arg1, msg.args.args64[1]);
+		UNSIGNED_LONGLONGS_EQUAL(arg2, msg.args.args64[2]);
+		UNSIGNED_LONGLONGS_EQUAL(arg3, msg.args.args64[3]);
+		UNSIGNED_LONGLONGS_EQUAL(arg4, msg.args.args64[4]);
+	}
+
+
 	struct ffa_params svc_result;
 	struct ffa_direct_msg msg;
 };
@@ -360,7 +375,7 @@
 	expect_ffa_svc(0x8400006B, 0, 0, 0, 0, 0, 0, 0, &svc_result);
 	ffa_result result = ffa_msg_wait(&msg);
 	LONGS_EQUAL(0, result);
-	msg_equal(0x84000061, 0, 0, 0, 0, 0, 0, 0);
+	msg_equal_32(0x84000061, 0, 0, 0, 0, 0, 0, 0);
 }
 
 TEST(ffa_api, ffa_msg_wait_error)
@@ -369,10 +384,10 @@
 	expect_ffa_svc(0x8400006B, 0, 0, 0, 0, 0, 0, 0, &svc_result);
 	ffa_result result = ffa_msg_wait(&msg);
 	LONGS_EQUAL(-1, result);
-	msg_equal(0, 0, 0, 0, 0, 0, 0, 0);
+	msg_equal_32(0, 0, 0, 0, 0, 0, 0, 0);
 }
 
-TEST(ffa_api, ffa_msg_wait_direct_req)
+TEST(ffa_api, ffa_msg_wait_direct_req_32)
 {
 	const uint16_t source_id = 0x1122;
 	const uint16_t dest_id = 0x3344;
@@ -392,7 +407,31 @@
 	expect_ffa_svc(0x8400006B, 0, 0, 0, 0, 0, 0, 0, &svc_result);
 	ffa_result result = ffa_msg_wait(&msg);
 	LONGS_EQUAL(0, result);
-	msg_equal(0x8400006F, source_id, dest_id, arg0, arg1, arg2, arg3,
+	msg_equal_32(0x8400006F, source_id, dest_id, arg0, arg1, arg2, arg3,
+		   arg4);
+}
+
+TEST(ffa_api, ffa_msg_wait_direct_req_64)
+{
+	const uint16_t source_id = 0x1122;
+	const uint16_t dest_id = 0x3344;
+	const uint64_t arg0 = 0x0123456776543210ULL;
+	const uint64_t arg1 = 0x1234567887654321ULL;
+	const uint64_t arg2 = 0x2345678998765432ULL;
+	const uint64_t arg3 = 0x3456789aa9876543ULL;
+	const uint64_t arg4 = 0x456789abba987654ULL;
+
+	svc_result.a0 = 0xC400006F;
+	svc_result.a1 = ((uint32_t)source_id) << 16 | dest_id;
+	svc_result.a3 = arg0;
+	svc_result.a4 = arg1;
+	svc_result.a5 = arg2;
+	svc_result.a6 = arg3;
+	svc_result.a7 = arg4;
+	expect_ffa_svc(0x8400006B, 0, 0, 0, 0, 0, 0, 0, &svc_result);
+	ffa_result result = ffa_msg_wait(&msg);
+	LONGS_EQUAL(0, result);
+	msg_equal_64(0xC400006F, source_id, dest_id, arg0, arg1, arg2, arg3,
 		   arg4);
 }
 
@@ -410,7 +449,7 @@
 	expect_ffa_svc(0x8400006B, 0, 0, 0, 0, 0, 0, 0, &svc_result);
 	ffa_result result = ffa_msg_wait(&msg);
 	LONGS_EQUAL(0, result);
-	msg_equal(0x84000061, 0, 0, 0, 0, 0, 0, 0);
+	msg_equal_32(0x84000061, 0, 0, 0, 0, 0, 0, 0);
 }
 
 TEST(ffa_api, ffa_msg_wait_two_interrupt_success)
@@ -434,7 +473,7 @@
 	expect_ffa_svc(0x8400006B, 0, 0, 0, 0, 0, 0, 0, &svc_result);
 	ffa_result result = ffa_msg_wait(&msg);
 	LONGS_EQUAL(0, result);
-	msg_equal(0x84000061, 0, 0, 0, 0, 0, 0, 0);
+	msg_equal_32(0x84000061, 0, 0, 0, 0, 0, 0, 0);
 }
 
 TEST(ffa_api, ffa_msg_wait_unknown_response)
@@ -448,7 +487,7 @@
 	}
 }
 
-TEST(ffa_api, ffa_msg_send_direct_req_success)
+TEST(ffa_api, ffa_msg_send_direct_req_32_success)
 {
 	const uint16_t source_id = 0x1122;
 	const uint16_t dest_id = 0x3344;
@@ -461,13 +500,13 @@
 	svc_result.a0 = 0x84000061;
 	expect_ffa_svc(0x8400006F, ((uint32_t)source_id << 16) | dest_id, 0,
 		       arg0, arg1, arg2, arg3, arg4, &svc_result);
-	ffa_result result = ffa_msg_send_direct_req(
+	ffa_result result = ffa_msg_send_direct_req_32(
 		source_id, dest_id, arg0, arg1, arg2, arg3, arg4, &msg);
 	LONGS_EQUAL(0, result);
-	msg_equal(0x84000061, 0, 0, 0, 0, 0, 0, 0);
+	msg_equal_32(0x84000061, 0, 0, 0, 0, 0, 0, 0);
 }
 
-TEST(ffa_api, ffa_msg_send_direct_req_error)
+TEST(ffa_api, ffa_msg_send_direct_req_32_error)
 {
 	const uint16_t source_id = 0x1122;
 	const uint16_t dest_id = 0x3344;
@@ -480,13 +519,48 @@
 	setup_error_response(-1);
 	expect_ffa_svc(0x8400006F, ((uint32_t)source_id << 16) | dest_id, 0,
 		       arg0, arg1, arg2, arg3, arg4, &svc_result);
-	ffa_result result = ffa_msg_send_direct_req(
+	ffa_result result = ffa_msg_send_direct_req_32(
 		source_id, dest_id, arg0, arg1, arg2, arg3, arg4, &msg);
 	LONGS_EQUAL(-1, result);
-	msg_equal(0, 0, 0, 0, 0, 0, 0, 0);
+	msg_equal_32(0, 0, 0, 0, 0, 0, 0, 0);
 }
 
-TEST(ffa_api, ffa_msg_send_direct_req_direct_resp)
+TEST(ffa_api, ffa_msg_send_direct_req_32_get_resp_64)
+{
+	const uint16_t source_id = 0x1122;
+	const uint16_t dest_id = 0x3344;
+	const uint32_t arg0 = 0x01234567ULL;
+	const uint32_t arg1 = 0x12345678ULL;
+	const uint32_t arg2 = 0x23456789ULL;
+	const uint32_t arg3 = 0x3456789aULL;
+	const uint32_t arg4 = 0x456789abULL;
+	const uint16_t resp_source_id = 0x1221;
+	const uint16_t resp_dest_id = 0x3443;
+	const uint64_t resp_arg0 = 0x9012345665432109ULL;
+	const uint64_t resp_arg1 = 0xa12345677654321aULL;
+	const uint64_t resp_arg2 = 0xb23456788765432bULL;
+	const uint64_t resp_arg3 = 0xc34567899876543cULL;
+	const uint64_t resp_arg4 = 0xd456789aa987654dULL;
+	assert_environment_t assert_env;
+
+	svc_result.a0 = 0xC4000070;
+	svc_result.a1 = ((uint32_t)resp_source_id) << 16 | resp_dest_id;
+	svc_result.a3 = resp_arg0;
+	svc_result.a4 = resp_arg1;
+	svc_result.a5 = resp_arg2;
+	svc_result.a6 = resp_arg3;
+	svc_result.a7 = resp_arg4;
+
+	expect_ffa_svc(0x8400006F, ((uint32_t)source_id << 16) | dest_id, 0,
+		       arg0, arg1, arg2, arg3, arg4, &svc_result);
+
+	if (SETUP_ASSERT_ENVIRONMENT(assert_env)) {
+		ffa_msg_send_direct_req_32(source_id, dest_id, arg0, arg1, arg2,
+					arg3, arg4, &msg);
+	}
+}
+
+TEST(ffa_api, ffa_msg_send_direct_req_32_direct_resp)
 {
 	const uint16_t source_id = 0x1122;
 	const uint16_t dest_id = 0x3344;
@@ -512,14 +586,82 @@
 	svc_result.a7 = resp_arg4;
 	expect_ffa_svc(0x8400006F, ((uint32_t)source_id << 16) | dest_id, 0,
 		       arg0, arg1, arg2, arg3, arg4, &svc_result);
-	ffa_result result = ffa_msg_send_direct_req(
+	ffa_result result = ffa_msg_send_direct_req_32(
 		source_id, dest_id, arg0, arg1, arg2, arg3, arg4, &msg);
 	LONGS_EQUAL(0, result);
-	msg_equal(0x84000070, resp_source_id, resp_dest_id, resp_arg0,
+	msg_equal_32(0x84000070, resp_source_id, resp_dest_id, resp_arg0,
 		   resp_arg1, resp_arg2, resp_arg3, resp_arg4);
 }
 
-TEST(ffa_api, ffa_msg_send_direct_req_one_interrupt_success)
+TEST(ffa_api, ffa_msg_send_direct_req_64_success)
+{
+	const uint16_t source_id = 0x1122;
+	const uint16_t dest_id = 0x3344;
+	const uint64_t arg0 = 0x0123456776543210ULL;
+	const uint64_t arg1 = 0x1234567887654321ULL;
+	const uint64_t arg2 = 0x2345678998765432ULL;
+	const uint64_t arg3 = 0x3456789aa9876543ULL;
+	const uint64_t arg4 = 0x456789abba987654ULL;
+	const uint16_t resp_source_id = 0x1221;
+	const uint16_t resp_dest_id = 0x3443;
+	const uint64_t resp_arg0 = 0x9012345665432109ULL;
+	const uint64_t resp_arg1 = 0xa12345677654321aULL;
+	const uint64_t resp_arg2 = 0xb23456788765432bULL;
+	const uint64_t resp_arg3 = 0xc34567899876543cULL;
+	const uint64_t resp_arg4 = 0xd456789aa987654dULL;
+
+	svc_result.a0 = 0xC4000070;
+	svc_result.a1 = ((uint32_t)resp_source_id) << 16 | resp_dest_id;
+	svc_result.a3 = resp_arg0;
+	svc_result.a4 = resp_arg1;
+	svc_result.a5 = resp_arg2;
+	svc_result.a6 = resp_arg3;
+	svc_result.a7 = resp_arg4;
+	expect_ffa_svc(0xC400006F, ((uint32_t)source_id << 16) | dest_id, 0,
+		       arg0, arg1, arg2, arg3, arg4, &svc_result);
+	ffa_result result = ffa_msg_send_direct_req_64(
+		source_id, dest_id, arg0, arg1, arg2, arg3, arg4, &msg);
+	LONGS_EQUAL(0, result);
+	msg_equal_64(0xC4000070, resp_source_id, resp_dest_id, resp_arg0,
+		   resp_arg1, resp_arg2, resp_arg3, resp_arg4);
+}
+
+TEST(ffa_api, ffa_msg_send_direct_req_64_get_resp_32)
+{
+	const uint16_t source_id = 0x1122;
+	const uint16_t dest_id = 0x3344;
+	const uint64_t arg0 = 0x9012345665432109ULL;
+	const uint64_t arg1 = 0xa12345677654321aULL;
+	const uint64_t arg2 = 0xb23456788765432bULL;
+	const uint64_t arg3 = 0xc34567899876543cULL;
+	const uint64_t arg4 = 0xd456789aa987654dULL;
+	const uint16_t resp_source_id = 0x1221;
+	const uint16_t resp_dest_id = 0x3443;
+	const uint32_t resp_arg0 = 0x01234567ULL;
+	const uint32_t resp_arg1 = 0x12345678ULL;
+	const uint32_t resp_arg2 = 0x23456789ULL;
+	const uint32_t resp_arg3 = 0x3456789aULL;
+	const uint32_t resp_arg4 = 0x456789abULL;
+	assert_environment_t assert_env;
+
+	svc_result.a0 = 0x84000070;
+	svc_result.a1 = ((uint32_t)resp_source_id) << 16 | resp_dest_id;
+	svc_result.a3 = resp_arg0;
+	svc_result.a4 = resp_arg1;
+	svc_result.a5 = resp_arg2;
+	svc_result.a6 = resp_arg3;
+	svc_result.a7 = resp_arg4;
+
+	expect_ffa_svc(0xC400006F, ((uint32_t)source_id << 16) | dest_id, 0,
+		       arg0, arg1, arg2, arg3, arg4, &svc_result);
+
+	if (SETUP_ASSERT_ENVIRONMENT(assert_env)) {
+		ffa_msg_send_direct_req_64(source_id, dest_id, arg0, arg1, arg2,
+					arg3, arg4, &msg);
+	}
+}
+
+TEST(ffa_api, ffa_msg_send_direct_req_32_one_interrupt_success)
 {
 	const uint16_t source_id = 0x1122;
 	const uint16_t dest_id = 0x3344;
@@ -539,13 +681,13 @@
 
 	svc_result.a0 = 0x84000061;
 	expect_ffa_svc(0x8400006B, 0, 0, 0, 0, 0, 0, 0, &svc_result);
-	ffa_result result = ffa_msg_send_direct_req(
+	ffa_result result = ffa_msg_send_direct_req_32(
 		source_id, dest_id, arg0, arg1, arg2, arg3, arg4, &msg);
 	LONGS_EQUAL(0, result);
-	msg_equal(0x84000061, 0, 0, 0, 0, 0, 0, 0);
+	msg_equal_32(0x84000061, 0, 0, 0, 0, 0, 0, 0);
 }
 
-TEST(ffa_api, ffa_msg_send_direct_req_two_interrupt_success)
+TEST(ffa_api, ffa_msg_send_direct_req_32_two_interrupt_success)
 {
 	const uint16_t source_id = 0x1122;
 	const uint16_t dest_id = 0x3344;
@@ -573,13 +715,13 @@
 
 	svc_result.a0 = 0x84000061;
 	expect_ffa_svc(0x8400006B, 0, 0, 0, 0, 0, 0, 0, &svc_result);
-	ffa_result result = ffa_msg_send_direct_req(
+	ffa_result result = ffa_msg_send_direct_req_32(
 		source_id, dest_id, arg0, arg1, arg2, arg3, arg4, &msg);
 	LONGS_EQUAL(0, result);
-	msg_equal(0x84000061, 0, 0, 0, 0, 0, 0, 0);
+	msg_equal_32(0x84000061, 0, 0, 0, 0, 0, 0, 0);
 }
 
-TEST(ffa_api, ffa_msg_send_direct_req_unknown_response)
+TEST(ffa_api, ffa_msg_send_direct_req_32_unknown_response)
 {
 	const uint16_t source_id = 0x1122;
 	const uint16_t dest_id = 0x3344;
@@ -594,12 +736,12 @@
 	expect_ffa_svc(0x8400006F, ((uint32_t)source_id << 16) | dest_id, 0,
 		       arg0, arg1, arg2, arg3, arg4, &svc_result);
 	if (SETUP_ASSERT_ENVIRONMENT(assert_env)) {
-		ffa_msg_send_direct_req(source_id, dest_id, arg0, arg1, arg2,
+		ffa_msg_send_direct_req_32(source_id, dest_id, arg0, arg1, arg2,
 					arg3, arg4, &msg);
 	}
 }
 
-TEST(ffa_api, ffa_msg_send_direct_resp_success)
+TEST(ffa_api, ffa_msg_send_direct_resp_32_success)
 {
 	const uint16_t source_id = 0x1122;
 	const uint16_t dest_id = 0x3344;
@@ -612,13 +754,13 @@
 	svc_result.a0 = 0x84000061;
 	expect_ffa_svc(0x84000070, ((uint32_t)source_id << 16) | dest_id, 0,
 		       arg0, arg1, arg2, arg3, arg4, &svc_result);
-	ffa_result result = ffa_msg_send_direct_resp(
+	ffa_result result = ffa_msg_send_direct_resp_32(
 		source_id, dest_id, arg0, arg1, arg2, arg3, arg4, &msg);
 	LONGS_EQUAL(0, result);
-	msg_equal(0x84000061, 0, 0, 0, 0, 0, 0, 0);
+	msg_equal_32(0x84000061, 0, 0, 0, 0, 0, 0, 0);
 }
 
-TEST(ffa_api, ffa_msg_send_direct_resp_error)
+TEST(ffa_api, ffa_msg_send_direct_resp_32_error)
 {
 	const uint16_t source_id = 0x1122;
 	const uint16_t dest_id = 0x3344;
@@ -631,13 +773,13 @@
 	setup_error_response(-1);
 	expect_ffa_svc(0x84000070, ((uint32_t)source_id << 16) | dest_id, 0,
 		       arg0, arg1, arg2, arg3, arg4, &svc_result);
-	ffa_result result = ffa_msg_send_direct_resp(
+	ffa_result result = ffa_msg_send_direct_resp_32(
 		source_id, dest_id, arg0, arg1, arg2, arg3, arg4, &msg);
 	LONGS_EQUAL(-1, result);
-	msg_equal(0, 0, 0, 0, 0, 0, 0, 0);
+	msg_equal_32(0, 0, 0, 0, 0, 0, 0, 0);
 }
 
-TEST(ffa_api, ffa_msg_send_direct_resp_then_get_direct_req_as_response)
+TEST(ffa_api, ffa_msg_send_direct_resp_32_then_get_direct_req_32_as_response)
 {
 	const uint16_t source_id = 0x1122;
 	const uint16_t dest_id = 0x3344;
@@ -663,14 +805,113 @@
 	svc_result.a7 = resp_arg4;
 	expect_ffa_svc(0x84000070, ((uint32_t)source_id << 16) | dest_id, 0,
 		       arg0, arg1, arg2, arg3, arg4, &svc_result);
-	ffa_result result = ffa_msg_send_direct_resp(
+	ffa_result result = ffa_msg_send_direct_resp_32(
 		source_id, dest_id, arg0, arg1, arg2, arg3, arg4, &msg);
 	LONGS_EQUAL(0, result);
-	msg_equal(0x8400006F, resp_source_id, resp_dest_id, resp_arg0,
+	msg_equal_32(0x8400006F, resp_source_id, resp_dest_id, resp_arg0,
 		   resp_arg1, resp_arg2, resp_arg3, resp_arg4);
 }
 
-TEST(ffa_api, ffa_msg_send_direct_resp_one_interrupt_success)
+TEST(ffa_api, ffa_msg_send_direct_resp_32_then_get_direct_req_64_as_response)
+{
+	const uint16_t source_id = 0x1122;
+	const uint16_t dest_id = 0x3344;
+	const uint32_t arg0 = 0x01234567ULL;
+	const uint32_t arg1 = 0x12345678ULL;
+	const uint32_t arg2 = 0x23456789ULL;
+	const uint32_t arg3 = 0x3456789aULL;
+	const uint32_t arg4 = 0x456789abULL;
+	const uint16_t resp_source_id = 0x1221;
+	const uint16_t resp_dest_id = 0x3443;
+	const uint64_t resp_arg0 = 0x9012345665432109ULL;
+	const uint64_t resp_arg1 = 0xa12345677654321aULL;
+	const uint64_t resp_arg2 = 0xb23456788765432bULL;
+	const uint64_t resp_arg3 = 0xc34567899876543cULL;
+	const uint64_t resp_arg4 = 0xd456789aa987654dULL;
+
+	svc_result.a0 = 0xC400006F;
+	svc_result.a1 = ((uint32_t)resp_source_id) << 16 | resp_dest_id;
+	svc_result.a3 = resp_arg0;
+	svc_result.a4 = resp_arg1;
+	svc_result.a5 = resp_arg2;
+	svc_result.a6 = resp_arg3;
+	svc_result.a7 = resp_arg4;
+	expect_ffa_svc(0x84000070, ((uint32_t)source_id << 16) | dest_id, 0,
+		       arg0, arg1, arg2, arg3, arg4, &svc_result);
+	ffa_result result = ffa_msg_send_direct_resp_32(
+		source_id, dest_id, arg0, arg1, arg2, arg3, arg4, &msg);
+	LONGS_EQUAL(0, result);
+	msg_equal_64(0xC400006F, resp_source_id, resp_dest_id, resp_arg0,
+		   resp_arg1, resp_arg2, resp_arg3, resp_arg4);
+}
+
+TEST(ffa_api, ffa_msg_send_direct_resp_64_then_get_direct_req_32_as_response)
+{
+	const uint16_t source_id = 0x1122;
+	const uint16_t dest_id = 0x3344;
+	const uint64_t arg0 = 0x9012345665432109ULL;
+	const uint64_t arg1 = 0xa12345677654321aULL;
+	const uint64_t arg2 = 0xb23456788765432bULL;
+	const uint64_t arg3 = 0xc34567899876543cULL;
+	const uint64_t arg4 = 0xd456789aa987654dULL;
+	const uint16_t resp_source_id = 0x1221;
+	const uint16_t resp_dest_id = 0x3443;
+	const uint32_t resp_arg0 = 0x01234567ULL;
+	const uint32_t resp_arg1 = 0x12345678ULL;
+	const uint32_t resp_arg2 = 0x23456789ULL;
+	const uint32_t resp_arg3 = 0x3456789aULL;
+	const uint32_t resp_arg4 = 0x456789abULL;
+
+	svc_result.a0 = 0x8400006F;
+	svc_result.a1 = ((uint32_t)resp_source_id) << 16 | resp_dest_id;
+	svc_result.a3 = resp_arg0;
+	svc_result.a4 = resp_arg1;
+	svc_result.a5 = resp_arg2;
+	svc_result.a6 = resp_arg3;
+	svc_result.a7 = resp_arg4;
+	expect_ffa_svc(0xC4000070, ((uint32_t)source_id << 16) | dest_id, 0,
+		       arg0, arg1, arg2, arg3, arg4, &svc_result);
+	ffa_result result = ffa_msg_send_direct_resp_64(
+		source_id, dest_id, arg0, arg1, arg2, arg3, arg4, &msg);
+	LONGS_EQUAL(0, result);
+	msg_equal_32(0x8400006F, resp_source_id, resp_dest_id, resp_arg0,
+		   resp_arg1, resp_arg2, resp_arg3, resp_arg4);
+}
+
+TEST(ffa_api, ffa_msg_send_direct_resp_64_then_get_direct_req_64_as_response)
+{
+	const uint16_t source_id = 0x1122;
+	const uint16_t dest_id = 0x3344;
+	const uint64_t arg0 = 0x0123456776543210ULL;
+	const uint64_t arg1 = 0x1234567887654321ULL;
+	const uint64_t arg2 = 0x2345678998765432ULL;
+	const uint64_t arg3 = 0x3456789aa9876543ULL;
+	const uint64_t arg4 = 0x456789abba987654ULL;
+	const uint16_t resp_source_id = 0x1221;
+	const uint16_t resp_dest_id = 0x3443;
+	const uint64_t resp_arg0 = 0x9012345665432109ULL;
+	const uint64_t resp_arg1 = 0xa12345677654321aULL;
+	const uint64_t resp_arg2 = 0xb23456788765432bULL;
+	const uint64_t resp_arg3 = 0xc34567899876543cULL;
+	const uint64_t resp_arg4 = 0xd456789aa987654dULL;
+
+	svc_result.a0 = 0xC400006F;
+	svc_result.a1 = ((uint32_t)resp_source_id) << 16 | resp_dest_id;
+	svc_result.a3 = resp_arg0;
+	svc_result.a4 = resp_arg1;
+	svc_result.a5 = resp_arg2;
+	svc_result.a6 = resp_arg3;
+	svc_result.a7 = resp_arg4;
+	expect_ffa_svc(0xC4000070, ((uint32_t)source_id << 16) | dest_id, 0,
+		       arg0, arg1, arg2, arg3, arg4, &svc_result);
+	ffa_result result = ffa_msg_send_direct_resp_64(
+		source_id, dest_id, arg0, arg1, arg2, arg3, arg4, &msg);
+	LONGS_EQUAL(0, result);
+	msg_equal_64(0xC400006F, resp_source_id, resp_dest_id, resp_arg0,
+		   resp_arg1, resp_arg2, resp_arg3, resp_arg4);
+}
+
+TEST(ffa_api, ffa_msg_send_direct_resp_32_one_interrupt_success)
 {
 	const uint16_t source_id = 0x1122;
 	const uint16_t dest_id = 0x3344;
@@ -690,13 +931,13 @@
 
 	svc_result.a0 = 0x84000061;
 	expect_ffa_svc(0x8400006B, 0, 0, 0, 0, 0, 0, 0, &svc_result);
-	ffa_result result = ffa_msg_send_direct_resp(
+	ffa_result result = ffa_msg_send_direct_resp_32(
 		source_id, dest_id, arg0, arg1, arg2, arg3, arg4, &msg);
 	LONGS_EQUAL(0, result);
-	msg_equal(0x84000061, 0, 0, 0, 0, 0, 0, 0);
+	msg_equal_32(0x84000061, 0, 0, 0, 0, 0, 0, 0);
 }
 
-TEST(ffa_api, ffa_msg_send_direct_resp_two_interrupt_success)
+TEST(ffa_api, ffa_msg_send_direct_resp_32_two_interrupt_success)
 {
 	const uint16_t source_id = 0x1122;
 	const uint16_t dest_id = 0x3344;
@@ -724,13 +965,13 @@
 
 	svc_result.a0 = 0x84000061;
 	expect_ffa_svc(0x8400006B, 0, 0, 0, 0, 0, 0, 0, &svc_result);
-	ffa_result result = ffa_msg_send_direct_resp(
+	ffa_result result = ffa_msg_send_direct_resp_32(
 		source_id, dest_id, arg0, arg1, arg2, arg3, arg4, &msg);
 	LONGS_EQUAL(0, result);
-	msg_equal(0x84000061, 0, 0, 0, 0, 0, 0, 0);
+	msg_equal_32(0x84000061, 0, 0, 0, 0, 0, 0, 0);
 }
 
-TEST(ffa_api, ffa_msg_send_direct_resp_unknown_response)
+TEST(ffa_api, ffa_msg_send_direct_resp_32_unknown_response)
 {
 	const uint16_t source_id = 0x1122;
 	const uint16_t dest_id = 0x3344;
@@ -745,7 +986,7 @@
 	expect_ffa_svc(0x84000070, ((uint32_t)source_id << 16) | dest_id, 0,
 		       arg0, arg1, arg2, arg3, arg4, &svc_result);
 	if (SETUP_ASSERT_ENVIRONMENT(assert_env)) {
-		ffa_msg_send_direct_resp(source_id, dest_id, arg0, arg1, arg2,
+		ffa_msg_send_direct_resp_32(source_id, dest_id, arg0, arg1, arg2,
 					 arg3, arg4, &msg);
 	}
 }
diff --git a/components/messaging/ffa/libsp/test/test_sp_messaging.cpp b/components/messaging/ffa/libsp/test/test_sp_messaging.cpp
index 78bf8bf..e6582e5 100644
--- a/components/messaging/ffa/libsp/test/test_sp_messaging.cpp
+++ b/components/messaging/ffa/libsp/test/test_sp_messaging.cpp
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: BSD-3-Clause
 /*
- * Copyright (c) 2021, Arm Limited. All rights reserved.
+ * Copyright (c) 2021-2022, Arm Limited. All rights reserved.
  */
 
 #include <CppUTest/TestHarness.h>
@@ -32,7 +32,7 @@
 		mock().clear();
 	}
 
-	void copy_sp_to_ffa_args(const uint32_t sp_args[], uint32_t ffa_args[])
+	void copy_sp_to_ffa_args_32(const uint32_t sp_args[], uint32_t ffa_args[])
 	{
 		int i = 0;
 
@@ -41,7 +41,16 @@
 		}
 	}
 
-	void fill_ffa_msg(struct ffa_direct_msg * msg)
+	void copy_sp_to_ffa_args_64(const uint64_t sp_args[], uint64_t ffa_args[])
+	{
+		int i = 0;
+
+		for (i = 0; i < SP_MSG_ARG_COUNT; i++) {
+			ffa_args[i + SP_MSG_ARG_OFFSET] = sp_args[i];
+		}
+	}
+
+	void fill_ffa_msg_32(struct ffa_direct_msg * msg)
 	{
 		int i = 0;
 
@@ -49,20 +58,47 @@
 		msg->source_id = source_id;
 		msg->destination_id = dest_id;
 
-		msg->args[0] = 0;
+		msg->args.args32[0] = 0;
 		for (i = 0; i < SP_MSG_ARG_COUNT; i++) {
-			msg->args[i + SP_MSG_ARG_OFFSET] = args[i];
+			msg->args.args32[i + SP_MSG_ARG_OFFSET] = args32[i];
 		}
 	}
 
-	void fill_sp_msg(struct sp_msg * msg)
+	void fill_ffa_msg_64(struct ffa_direct_msg * msg)
+	{
+		int i = 0;
+
+		msg->function_id = FFA_MSG_SEND_DIRECT_REQ_64;
+		msg->source_id = source_id;
+		msg->destination_id = dest_id;
+
+		msg->args.args64[0] = 0;
+		for (i = 0; i < SP_MSG_ARG_COUNT; i++) {
+			msg->args.args64[i + SP_MSG_ARG_OFFSET] = args64[i];
+		}
+	}
+
+	void fill_sp_msg_32(struct sp_msg * msg)
 	{
 		int i = 0;
 
 		msg->source_id = source_id;
 		msg->destination_id = dest_id;
+		msg->is_64bit_message = false;
 		for (i = 0; i < SP_MSG_ARG_COUNT; i++) {
-			msg->args[i] = args[i + SP_MSG_ARG_OFFSET];
+			msg->args.args32[i] = args32[i + SP_MSG_ARG_OFFSET];
+		}
+	}
+
+	void fill_sp_msg_64(struct sp_msg * msg)
+	{
+		int i = 0;
+
+		msg->source_id = source_id;
+		msg->destination_id = dest_id;
+		msg->is_64bit_message = true;
+		for (i = 0; i < SP_MSG_ARG_COUNT; i++) {
+			msg->args.args64[i] = args64[i + SP_MSG_ARG_OFFSET];
 		}
 	}
 
@@ -74,10 +110,19 @@
 		UNSIGNED_LONGS_EQUAL(ffa_msg->source_id, sp_msg->source_id);
 		UNSIGNED_LONGS_EQUAL(ffa_msg->destination_id,
 				     sp_msg->destination_id);
-		for (i = 0; i < SP_MSG_ARG_COUNT; i++) {
-			UNSIGNED_LONGS_EQUAL(
-				ffa_msg->args[i + SP_MSG_ARG_OFFSET],
-				sp_msg->args[i]);
+		CHECK_EQUAL(FFA_IS_64_BIT_FUNC(ffa_msg->function_id), sp_msg->is_64bit_message);
+		if (sp_msg->is_64bit_message) {
+			for (i = 0; i < SP_MSG_ARG_COUNT; i++) {
+				UNSIGNED_LONGLONGS_EQUAL(
+					ffa_msg->args.args64[i + SP_MSG_ARG_OFFSET],
+					sp_msg->args.args64[i]);
+			}
+		} else {
+			for (i = 0; i < SP_MSG_ARG_COUNT; i++) {
+				UNSIGNED_LONGS_EQUAL(
+					ffa_msg->args.args32[i + SP_MSG_ARG_OFFSET],
+					sp_msg->args.args32[i]);
+			}
 		}
 	}
 
@@ -87,7 +132,7 @@
 		struct ffa_direct_msg expected_ffa_req = { 0 };
 		struct sp_msg req = { 0 };
 
-		fill_ffa_msg(&expected_ffa_req);
+		fill_ffa_msg_32(&expected_ffa_req);
 		expected_ffa_req.source_id = source_id;
 		expected_ffa_req.destination_id = dest_id;
 		expect_ffa_msg_wait(&expected_ffa_req, FFA_OK);
@@ -103,8 +148,10 @@
 
 	const uint16_t source_id = 0x1234;
 	const uint16_t dest_id = 0x5678;
-	const uint32_t args[SP_MSG_ARG_COUNT] = { 0x01234567, 0x12345678,
-						  0x23456789, 0x3456789a };
+	const uint32_t args32[SP_MSG_ARG_COUNT] = { 0x01234567, 0x12345678,
+						    0x23456789, 0x3456789a };
+	const uint64_t args64[SP_MSG_ARG_COUNT] = { 0x0123456776543210, 0x1234567887654321,
+						    0x2345678998765432, 0x3456789aa9876543 };
 	const sp_result result = -1;
 	const sp_msg empty_sp_msg = (const sp_msg){ 0 };
 };
@@ -126,7 +173,7 @@
 
 TEST(sp_messaging, sp_msg_wait)
 {
-	fill_ffa_msg(&ffa_msg);
+	fill_ffa_msg_32(&ffa_msg);
 	expect_ffa_msg_wait(&ffa_msg, FFA_OK);
 
 	LONGS_EQUAL(SP_RESULT_OK, sp_msg_wait(&req));
@@ -139,12 +186,12 @@
 	struct ffa_direct_msg rc_msg = { 0 };
 	ffa_result result = FFA_ABORTED;
 
-	fill_ffa_msg(&rc_msg);
-	rc_msg.args[0] = ROUTING_EXT_RC_BIT;
+	fill_ffa_msg_32(&rc_msg);
+	rc_msg.args.args32[0] = ROUTING_EXT_RC_BIT;
 	expect_ffa_msg_wait(&rc_msg, FFA_OK);
 
-	fill_ffa_msg(&ffa_msg);
-	expect_ffa_msg_send_direct_resp(
+	fill_ffa_msg_32(&ffa_msg);
+	expect_ffa_msg_send_direct_resp_32(
 		rc_msg.destination_id, rc_msg.source_id,
 		ROUTING_EXT_RC_BIT | ROUTING_EXT_ERR_BIT,
 		SP_RESULT_FFA(FFA_DENIED), 0, 0, 0, &ffa_msg, result);
@@ -157,12 +204,12 @@
 {
 	struct ffa_direct_msg rc_msg = { 0 };
 
-	fill_ffa_msg(&rc_msg);
-	rc_msg.args[0] = ROUTING_EXT_RC_BIT;
+	fill_ffa_msg_32(&rc_msg);
+	rc_msg.args.args32[0] = ROUTING_EXT_RC_BIT;
 	expect_ffa_msg_wait(&rc_msg, FFA_OK);
 
-	fill_ffa_msg(&ffa_msg);
-	expect_ffa_msg_send_direct_resp(
+	fill_ffa_msg_32(&ffa_msg);
+	expect_ffa_msg_send_direct_resp_32(
 		rc_msg.destination_id, rc_msg.source_id,
 		ROUTING_EXT_RC_BIT | ROUTING_EXT_ERR_BIT,
 		SP_RESULT_FFA(FFA_DENIED), 0, 0, 0, &ffa_msg, FFA_OK);
@@ -191,10 +238,10 @@
 	ffa_result result = FFA_ABORTED;
 	uint32_t expected_ffa_args[5] = { 0 };
 
-	fill_sp_msg(&req);
+	fill_sp_msg_32(&req);
 	memset(&resp, 0x5a, sizeof(resp));
-	copy_sp_to_ffa_args(req.args, expected_ffa_args);
-	expect_ffa_msg_send_direct_req(
+	copy_sp_to_ffa_args_32(req.args.args32, expected_ffa_args);
+	expect_ffa_msg_send_direct_req_32(
 		req.source_id, req.destination_id, expected_ffa_args[0],
 		expected_ffa_args[1], expected_ffa_args[2],
 		expected_ffa_args[3], expected_ffa_args[4], &ffa_msg, result);
@@ -203,14 +250,30 @@
 	MEMCMP_EQUAL(&empty_sp_msg, &resp, sizeof(empty_sp_msg));
 }
 
-TEST(sp_messaging, sp_msg_send_direct_req_msg)
+TEST(sp_messaging, sp_msg_send_direct_req_msg_32)
 {
 	uint32_t expected_ffa_args[5] = { 0 };
 
-	fill_sp_msg(&req);
-	fill_ffa_msg(&ffa_msg);
-	copy_sp_to_ffa_args(req.args, expected_ffa_args);
-	expect_ffa_msg_send_direct_req(
+	fill_sp_msg_32(&req);
+	fill_ffa_msg_32(&ffa_msg);
+	copy_sp_to_ffa_args_32(req.args.args32, expected_ffa_args);
+	expect_ffa_msg_send_direct_req_32(
+		req.source_id, req.destination_id, expected_ffa_args[0],
+		expected_ffa_args[1], expected_ffa_args[2],
+		expected_ffa_args[3], expected_ffa_args[4], &ffa_msg, FFA_OK);
+
+	LONGS_EQUAL(SP_RESULT_OK, sp_msg_send_direct_req(&req, &resp));
+	ffa_and_sp_msg_equal(&ffa_msg, &resp);
+}
+
+TEST(sp_messaging, sp_msg_send_direct_req_msg_64)
+{
+	uint64_t expected_ffa_args[5] = { 0 };
+
+	fill_sp_msg_64(&req);
+	fill_ffa_msg_64(&ffa_msg);
+	copy_sp_to_ffa_args_64(req.args.args64, expected_ffa_args);
+	expect_ffa_msg_send_direct_req_64(
 		req.source_id, req.destination_id, expected_ffa_args[0],
 		expected_ffa_args[1], expected_ffa_args[2],
 		expected_ffa_args[3], expected_ffa_args[4], &ffa_msg, FFA_OK);
@@ -223,10 +286,10 @@
 {
 	uint32_t expected_ffa_args[5] = { 0 };
 
-	fill_sp_msg(&req);
+	fill_sp_msg_32(&req);
 	ffa_msg.function_id = FFA_SUCCESS_32;
-	copy_sp_to_ffa_args(req.args, expected_ffa_args);
-	expect_ffa_msg_send_direct_req(
+	copy_sp_to_ffa_args_32(req.args.args32, expected_ffa_args);
+	expect_ffa_msg_send_direct_req_32(
 		req.source_id, req.destination_id, expected_ffa_args[0],
 		expected_ffa_args[1], expected_ffa_args[2],
 		expected_ffa_args[3], expected_ffa_args[4], &ffa_msg, FFA_OK);
@@ -248,54 +311,54 @@
 	sp_msg sp_req = { 0 };
 	sp_msg sp_resp = { 0 };
 
-	fill_sp_msg(&sp_req);
+	fill_sp_msg_32(&sp_req);
 	sp_req.source_id = own_id;
 	sp_req.destination_id = rc_root_id;
 
 	req.function_id = FFA_MSG_SEND_DIRECT_REQ_32;
 	req.source_id = own_id;
 	req.destination_id = rc_root_id;
-	copy_sp_to_ffa_args(sp_req.args, req.args);
+	copy_sp_to_ffa_args_32(sp_req.args.args32, req.args.args32);
 
-	fill_ffa_msg(&rc_req);
+	fill_ffa_msg_32(&rc_req);
 	rc_req.function_id = FFA_MSG_SEND_DIRECT_RESP_32;
 	rc_req.source_id = rc_root_id;
 	rc_req.destination_id = own_id;
-	rc_req.args[0] = ROUTING_EXT_RC_BIT;
+	rc_req.args.args32[0] = ROUTING_EXT_RC_BIT;
 
-	fill_ffa_msg(&rc_resp);
+	fill_ffa_msg_32(&rc_resp);
 	rc_resp.function_id = FFA_MSG_SEND_DIRECT_REQ_32;
 	rc_resp.source_id = root_id;
 	rc_resp.destination_id = own_id;
-	rc_resp.args[0] = ROUTING_EXT_RC_BIT;
+	rc_resp.args.args32[0] = ROUTING_EXT_RC_BIT;
 
-	fill_sp_msg(&sp_resp);
+	fill_sp_msg_32(&sp_resp);
 	sp_resp.source_id = rc_root_id;
 	sp_resp.destination_id = own_id;
 
 	resp.function_id = FFA_MSG_SEND_DIRECT_RESP_32;
 	resp.source_id = rc_root_id;
 	resp.destination_id = own_id;
-	copy_sp_to_ffa_args(sp_resp.args, resp.args);
+	copy_sp_to_ffa_args_32(sp_resp.args.args32, resp.args.args32);
 
 	/* Initial request to current SP to set own_id */
 	wait_and_receive_request(root_id, own_id);
 
 	/* Sending request and receiving RC request from RC root */
-	expect_ffa_msg_send_direct_req(own_id, rc_root_id, 0, req.args[1],
-				       req.args[2], req.args[3], req.args[4],
+	expect_ffa_msg_send_direct_req_32(own_id, rc_root_id, 0, req.args.args32[1],
+				       req.args.args32[2], req.args.args32[3], req.args.args32[4],
 				       &rc_req, FFA_OK);
 
 	/* Forwarding RC request to root and receiving RC response */
-	expect_ffa_msg_send_direct_resp(own_id, root_id, rc_req.args[0],
-					rc_req.args[1], rc_req.args[2],
-					rc_req.args[3], rc_req.args[4],
+	expect_ffa_msg_send_direct_resp_32(own_id, root_id, rc_req.args.args32[0],
+					rc_req.args.args32[1], rc_req.args.args32[2],
+					rc_req.args.args32[3], rc_req.args.args32[4],
 					&rc_resp, FFA_OK);
 
 	/* Fowarding RC response to RC root and receiving response */
-	expect_ffa_msg_send_direct_req(own_id, rc_root_id, rc_resp.args[0],
-				       rc_resp.args[1], rc_resp.args[2],
-				       rc_resp.args[3], rc_resp.args[4], &resp,
+	expect_ffa_msg_send_direct_req_32(own_id, rc_root_id, rc_resp.args.args32[0],
+				       rc_resp.args.args32[1], rc_resp.args.args32[2],
+				       rc_resp.args.args32[3], rc_resp.args.args32[4], &resp,
 				       FFA_OK);
 
 	LONGS_EQUAL(SP_RESULT_OK, sp_msg_send_direct_req(&sp_req, &sp_resp));
@@ -312,28 +375,28 @@
 	sp_msg sp_req = { 0 };
 	sp_msg sp_resp = { 0 };
 
-	fill_sp_msg(&sp_req);
+	fill_sp_msg_32(&sp_req);
 	sp_req.source_id = own_id;
 	sp_req.destination_id = rc_root_id;
 
 	req.function_id = FFA_MSG_SEND_DIRECT_REQ_32;
 	req.source_id = own_id;
 	req.destination_id = rc_root_id;
-	copy_sp_to_ffa_args(sp_req.args, req.args);
+	copy_sp_to_ffa_args_32(sp_req.args.args32, req.args.args32);
 
-	fill_ffa_msg(&rc_err);
+	fill_ffa_msg_32(&rc_err);
 	rc_err.function_id = FFA_MSG_SEND_DIRECT_RESP_32;
 	rc_err.source_id = rc_root_id;
 	rc_err.destination_id = own_id;
-	rc_err.args[0] = ROUTING_EXT_RC_BIT | ROUTING_EXT_ERR_BIT;
-	rc_err.args[1] = result;
+	rc_err.args.args32[0] = ROUTING_EXT_RC_BIT | ROUTING_EXT_ERR_BIT;
+	rc_err.args.args32[1] = result;
 
 	/* Initial request to current SP to set own_id */
 	wait_and_receive_request(root_id, own_id);
 
 	/* Sending request and receiving RC request from RC root */
-	expect_ffa_msg_send_direct_req(own_id, rc_root_id, 0, req.args[1],
-				       req.args[2], req.args[3], req.args[4],
+	expect_ffa_msg_send_direct_req_32(own_id, rc_root_id, 0, req.args.args32[1],
+				       req.args.args32[2], req.args.args32[3], req.args.args32[4],
 				       &rc_err, FFA_OK);
 
 	LONGS_EQUAL(SP_RESULT_FFA(result),
@@ -354,64 +417,64 @@
 	sp_msg sp_req = { 0 };
 	sp_msg sp_resp = { 0 };
 
-	fill_sp_msg(&sp_req);
+	fill_sp_msg_32(&sp_req);
 	sp_req.source_id = own_id;
 	sp_req.destination_id = rc_root_id;
 
 	req.function_id = FFA_MSG_SEND_DIRECT_REQ_32;
 	req.source_id = own_id;
 	req.destination_id = rc_root_id;
-	copy_sp_to_ffa_args(sp_req.args, req.args);
+	copy_sp_to_ffa_args_32(sp_req.args.args32, req.args.args32);
 
-	fill_ffa_msg(&rc_req);
+	fill_ffa_msg_32(&rc_req);
 	rc_req.function_id = FFA_MSG_SEND_DIRECT_RESP_32;
 	rc_req.source_id = rc_root_id;
 	rc_req.destination_id = own_id;
-	rc_req.args[0] = ROUTING_EXT_RC_BIT;
+	rc_req.args.args32[0] = ROUTING_EXT_RC_BIT;
 
 	request_to_deny.function_id = FFA_MSG_SEND_DIRECT_REQ_32;
 	request_to_deny.source_id = root_id;
 	request_to_deny.destination_id = own_id;
-	request_to_deny.args[0] = 0;
+	request_to_deny.args.args32[0] = 0;
 
-	fill_ffa_msg(&rc_resp);
+	fill_ffa_msg_32(&rc_resp);
 	rc_resp.function_id = FFA_MSG_SEND_DIRECT_REQ_32;
 	rc_resp.source_id = root_id;
 	rc_resp.destination_id = own_id;
-	rc_resp.args[0] = ROUTING_EXT_RC_BIT;
+	rc_resp.args.args32[0] = ROUTING_EXT_RC_BIT;
 
-	fill_sp_msg(&sp_resp);
+	fill_sp_msg_32(&sp_resp);
 	sp_resp.source_id = rc_root_id;
 	sp_resp.destination_id = own_id;
 
 	resp.function_id = FFA_MSG_SEND_DIRECT_RESP_32;
 	resp.source_id = rc_root_id;
 	resp.destination_id = own_id;
-	copy_sp_to_ffa_args(sp_resp.args, resp.args);
+	copy_sp_to_ffa_args_32(sp_resp.args.args32, resp.args.args32);
 
 	/* Initial request to current SP to set own_id */
 	wait_and_receive_request(root_id, own_id);
 
 	/* Sending request and receiving RC request from RC root */
-	expect_ffa_msg_send_direct_req(own_id, rc_root_id, 0, req.args[1],
-				       req.args[2], req.args[3], req.args[4],
+	expect_ffa_msg_send_direct_req_32(own_id, rc_root_id, 0, req.args.args32[1],
+				       req.args.args32[2], req.args.args32[3], req.args.args32[4],
 				       &rc_req, FFA_OK);
 
 	/* Forwarding RC request to root and receiving a request to deny */
-	expect_ffa_msg_send_direct_resp(own_id, root_id, rc_req.args[0],
-					rc_req.args[1], rc_req.args[2],
-					rc_req.args[3], rc_req.args[4],
+	expect_ffa_msg_send_direct_resp_32(own_id, root_id, rc_req.args.args32[0],
+					rc_req.args.args32[1], rc_req.args.args32[2],
+					rc_req.args.args32[3], rc_req.args.args32[4],
 					&request_to_deny, FFA_OK);
 
 	/* Sending error to root and receiving RC response */
-	expect_ffa_msg_send_direct_resp(
+	expect_ffa_msg_send_direct_resp_32(
 		own_id, root_id, ROUTING_EXT_RC_BIT | ROUTING_EXT_ERR_BIT,
 		SP_RESULT_FFA(FFA_BUSY), 0, 0, 0, &rc_resp, FFA_OK);
 
 	/* Fowarding RC response to RC root and receiving response */
-	expect_ffa_msg_send_direct_req(own_id, rc_root_id, rc_resp.args[0],
-				       rc_resp.args[1], rc_resp.args[2],
-				       rc_resp.args[3], rc_resp.args[4], &resp,
+	expect_ffa_msg_send_direct_req_32(own_id, rc_root_id, rc_resp.args.args32[0],
+				       rc_resp.args.args32[1], rc_resp.args.args32[2],
+				       rc_resp.args.args32[3], rc_resp.args.args32[4], &resp,
 				       FFA_OK);
 
 	LONGS_EQUAL(SP_RESULT_OK, sp_msg_send_direct_req(&sp_req, &sp_resp));
@@ -431,65 +494,65 @@
 	sp_msg sp_req = { 0 };
 	sp_msg sp_resp = { 0 };
 
-	fill_sp_msg(&sp_req);
+	fill_sp_msg_32(&sp_req);
 	sp_req.source_id = own_id;
 	sp_req.destination_id = rc_root_id;
 
 	req.function_id = FFA_MSG_SEND_DIRECT_REQ_32;
 	req.source_id = own_id;
 	req.destination_id = rc_root_id;
-	copy_sp_to_ffa_args(sp_req.args, req.args);
+	copy_sp_to_ffa_args_32(sp_req.args.args32, req.args.args32);
 
-	fill_ffa_msg(&rc_req);
+	fill_ffa_msg_32(&rc_req);
 	rc_req.function_id = FFA_MSG_SEND_DIRECT_RESP_32;
 	rc_req.source_id = rc_root_id;
 	rc_req.destination_id = own_id;
-	rc_req.args[0] = ROUTING_EXT_RC_BIT;
+	rc_req.args.args32[0] = ROUTING_EXT_RC_BIT;
 
 	request_to_deny.function_id = FFA_MSG_SEND_DIRECT_REQ_32;
 	/* This source ID should be denied in the current state. */
 	request_to_deny.source_id = rc_root_id;
 	request_to_deny.destination_id = own_id;
-	request_to_deny.args[0] = ROUTING_EXT_RC_BIT;
+	request_to_deny.args.args32[0] = ROUTING_EXT_RC_BIT;
 
-	fill_ffa_msg(&rc_resp);
+	fill_ffa_msg_32(&rc_resp);
 	rc_resp.function_id = FFA_MSG_SEND_DIRECT_REQ_32;
 	rc_resp.source_id = root_id;
 	rc_resp.destination_id = own_id;
-	rc_resp.args[0] = ROUTING_EXT_RC_BIT;
+	rc_resp.args.args32[0] = ROUTING_EXT_RC_BIT;
 
-	fill_sp_msg(&sp_resp);
+	fill_sp_msg_32(&sp_resp);
 	sp_resp.source_id = rc_root_id;
 	sp_resp.destination_id = own_id;
 
 	resp.function_id = FFA_MSG_SEND_DIRECT_RESP_32;
 	resp.source_id = rc_root_id;
 	resp.destination_id = own_id;
-	copy_sp_to_ffa_args(sp_resp.args, resp.args);
+	copy_sp_to_ffa_args_32(sp_resp.args.args32, resp.args.args32);
 
 	/* Initial request to current SP to set own_id */
 	wait_and_receive_request(root_id, own_id);
 
 	/* Sending request and receiving RC request from RC root */
-	expect_ffa_msg_send_direct_req(own_id, rc_root_id, 0, req.args[1],
-				       req.args[2], req.args[3], req.args[4],
+	expect_ffa_msg_send_direct_req_32(own_id, rc_root_id, 0, req.args.args32[1],
+				       req.args.args32[2], req.args.args32[3], req.args.args32[4],
 				       &rc_req, FFA_OK);
 
 	/* Forwarding RC request to root and receiving RC response */
-	expect_ffa_msg_send_direct_resp(own_id, root_id, rc_req.args[0],
-					rc_req.args[1], rc_req.args[2],
-					rc_req.args[3], rc_req.args[4],
+	expect_ffa_msg_send_direct_resp_32(own_id, root_id, rc_req.args.args32[0],
+					rc_req.args.args32[1], rc_req.args.args32[2],
+					rc_req.args.args32[3], rc_req.args.args32[4],
 					&request_to_deny, FFA_OK);
 
 	/* Sending error to root and receiving RC response */
-	expect_ffa_msg_send_direct_resp(
+	expect_ffa_msg_send_direct_resp_32(
 		own_id, rc_root_id, ROUTING_EXT_ERR_BIT | ROUTING_EXT_RC_BIT,
 		SP_RESULT_FFA(FFA_BUSY), 0, 0, 0, &rc_resp, FFA_OK);
 
 	/* Fowarding RC response to RC root and receiving response */
-	expect_ffa_msg_send_direct_req(own_id, rc_root_id, rc_resp.args[0],
-				       rc_resp.args[1], rc_resp.args[2],
-				       rc_resp.args[3], rc_resp.args[4], &resp,
+	expect_ffa_msg_send_direct_req_32(own_id, rc_root_id, rc_resp.args.args32[0],
+				       rc_resp.args.args32[1], rc_resp.args.args32[2],
+				       rc_resp.args.args32[3], rc_resp.args.args32[4], &resp,
 				       FFA_OK);
 
 	LONGS_EQUAL(SP_RESULT_OK, sp_msg_send_direct_req(&sp_req, &sp_resp));
@@ -509,58 +572,58 @@
 	sp_msg sp_req = { 0 };
 	sp_msg sp_resp = { 0 };
 
-	fill_sp_msg(&sp_req);
+	fill_sp_msg_32(&sp_req);
 	sp_req.source_id = own_id;
 	sp_req.destination_id = rc_root_id;
 
 	req.function_id = FFA_MSG_SEND_DIRECT_REQ_32;
 	req.source_id = own_id;
 	req.destination_id = rc_root_id;
-	copy_sp_to_ffa_args(sp_req.args, req.args);
+	copy_sp_to_ffa_args_32(sp_req.args.args32, req.args.args32);
 
-	fill_ffa_msg(&rc_req);
+	fill_ffa_msg_32(&rc_req);
 	rc_req.function_id = FFA_MSG_SEND_DIRECT_RESP_32;
 	rc_req.source_id = rc_root_id;
 	rc_req.destination_id = own_id;
-	rc_req.args[0] = ROUTING_EXT_RC_BIT;
+	rc_req.args.args32[0] = ROUTING_EXT_RC_BIT;
 
 	request_to_deny.function_id = FFA_MSG_SEND_DIRECT_REQ_32;
 	/* This source ID should be denied in the current state. */
 	request_to_deny.source_id = rc_root_id;
 	request_to_deny.destination_id = own_id;
-	request_to_deny.args[0] = ROUTING_EXT_RC_BIT;
+	request_to_deny.args.args32[0] = ROUTING_EXT_RC_BIT;
 
-	fill_ffa_msg(&rc_resp);
+	fill_ffa_msg_32(&rc_resp);
 	rc_resp.function_id = FFA_MSG_SEND_DIRECT_REQ_32;
 	rc_resp.source_id = root_id;
 	rc_resp.destination_id = own_id;
-	rc_resp.args[0] = ROUTING_EXT_RC_BIT;
+	rc_resp.args.args32[0] = ROUTING_EXT_RC_BIT;
 
-	fill_sp_msg(&sp_resp);
+	fill_sp_msg_32(&sp_resp);
 	sp_resp.source_id = rc_root_id;
 	sp_resp.destination_id = own_id;
 
 	resp.function_id = FFA_MSG_SEND_DIRECT_RESP_32;
 	resp.source_id = rc_root_id;
 	resp.destination_id = own_id;
-	copy_sp_to_ffa_args(sp_resp.args, resp.args);
+	copy_sp_to_ffa_args_32(sp_resp.args.args32, resp.args.args32);
 
 	/* Initial request to current SP to set own_id */
 	wait_and_receive_request(root_id, own_id);
 
 	/* Sending request and receiving RC request from RC root */
-	expect_ffa_msg_send_direct_req(own_id, rc_root_id, 0, req.args[1],
-				       req.args[2], req.args[3], req.args[4],
+	expect_ffa_msg_send_direct_req_32(own_id, rc_root_id, 0, req.args.args32[1],
+				       req.args.args32[2], req.args.args32[3], req.args.args32[4],
 				       &rc_req, FFA_OK);
 
 	/* Forwarding RC request to root and receiving RC response */
-	expect_ffa_msg_send_direct_resp(own_id, root_id, rc_req.args[0],
-					rc_req.args[1], rc_req.args[2],
-					rc_req.args[3], rc_req.args[4],
+	expect_ffa_msg_send_direct_resp_32(own_id, root_id, rc_req.args.args32[0],
+					rc_req.args.args32[1], rc_req.args.args32[2],
+					rc_req.args.args32[3], rc_req.args.args32[4],
 					&request_to_deny, FFA_OK);
 
 	/* Sending error to root which fails */
-	expect_ffa_msg_send_direct_resp(
+	expect_ffa_msg_send_direct_resp_32(
 		own_id, rc_root_id, (ROUTING_EXT_ERR_BIT | ROUTING_EXT_RC_BIT),
 		SP_RESULT_FFA(FFA_BUSY), 0, 0, 0, &rc_resp, FFA_DENIED);
 
@@ -568,9 +631,9 @@
 	expect_ffa_msg_wait(&rc_resp, FFA_OK);
 
 	/* Fowarding RC response to RC root and receiving response */
-	expect_ffa_msg_send_direct_req(own_id, rc_root_id, rc_resp.args[0],
-				       rc_resp.args[1], rc_resp.args[2],
-				       rc_resp.args[3], rc_resp.args[4], &resp,
+	expect_ffa_msg_send_direct_req_32(own_id, rc_root_id, rc_resp.args.args32[0],
+				       rc_resp.args.args32[1], rc_resp.args.args32[2],
+				       rc_resp.args.args32[3], rc_resp.args.args32[4], &resp,
 				       FFA_OK);
 
 	LONGS_EQUAL(SP_RESULT_OK, sp_msg_send_direct_req(&sp_req, &sp_resp));
@@ -590,58 +653,58 @@
 	sp_msg sp_req = { 0 };
 	sp_msg sp_resp = { 0 };
 
-	fill_sp_msg(&sp_req);
+	fill_sp_msg_32(&sp_req);
 	sp_req.source_id = own_id;
 	sp_req.destination_id = rc_root_id;
 
 	req.function_id = FFA_MSG_SEND_DIRECT_REQ_32;
 	req.source_id = own_id;
 	req.destination_id = rc_root_id;
-	copy_sp_to_ffa_args(sp_req.args, req.args);
+	copy_sp_to_ffa_args_32(sp_req.args.args32, req.args.args32);
 
-	fill_ffa_msg(&rc_req);
+	fill_ffa_msg_32(&rc_req);
 	rc_req.function_id = FFA_MSG_SEND_DIRECT_RESP_32;
 	rc_req.source_id = rc_root_id;
 	rc_req.destination_id = own_id;
-	rc_req.args[0] = ROUTING_EXT_RC_BIT;
+	rc_req.args.args32[0] = ROUTING_EXT_RC_BIT;
 
 	request_to_deny.function_id = FFA_MSG_SEND_DIRECT_REQ_32;
 	/* This source ID should be denied in the current state. */
 	request_to_deny.source_id = rc_root_id;
 	request_to_deny.destination_id = own_id;
-	request_to_deny.args[0] = ROUTING_EXT_RC_BIT;
+	request_to_deny.args.args32[0] = ROUTING_EXT_RC_BIT;
 
-	fill_ffa_msg(&rc_resp);
+	fill_ffa_msg_32(&rc_resp);
 	rc_resp.function_id = FFA_MSG_SEND_DIRECT_REQ_32;
 	rc_resp.source_id = root_id;
 	rc_resp.destination_id = own_id;
-	rc_resp.args[0] = ROUTING_EXT_RC_BIT;
+	rc_resp.args.args32[0] = ROUTING_EXT_RC_BIT;
 
-	fill_sp_msg(&sp_resp);
+	fill_sp_msg_32(&sp_resp);
 	sp_resp.source_id = rc_root_id;
 	sp_resp.destination_id = own_id;
 
 	resp.function_id = FFA_MSG_SEND_DIRECT_RESP_32;
 	resp.source_id = rc_root_id;
 	resp.destination_id = own_id;
-	copy_sp_to_ffa_args(sp_resp.args, resp.args);
+	copy_sp_to_ffa_args_32(sp_resp.args.args32, resp.args.args32);
 
 	/* Initial request to current SP to set own_id */
 	wait_and_receive_request(root_id, own_id);
 
 	/* Sending request and receiving RC request from RC root */
-	expect_ffa_msg_send_direct_req(own_id, rc_root_id, 0, req.args[1],
-				       req.args[2], req.args[3], req.args[4],
+	expect_ffa_msg_send_direct_req_32(own_id, rc_root_id, 0, req.args.args32[1],
+				       req.args.args32[2], req.args.args32[3], req.args.args32[4],
 				       &rc_req, FFA_OK);
 
 	/* Forwarding RC request to root and receiving RC response */
-	expect_ffa_msg_send_direct_resp(own_id, root_id, rc_req.args[0],
-					rc_req.args[1], rc_req.args[2],
-					rc_req.args[3], rc_req.args[4],
+	expect_ffa_msg_send_direct_resp_32(own_id, root_id, rc_req.args.args32[0],
+					rc_req.args.args32[1], rc_req.args.args32[2],
+					rc_req.args.args32[3], rc_req.args.args32[4],
 					&request_to_deny, FFA_OK);
 
 	/* Sending error to root which fails */
-	expect_ffa_msg_send_direct_resp(
+	expect_ffa_msg_send_direct_resp_32(
 		own_id, rc_root_id, ROUTING_EXT_ERR_BIT | ROUTING_EXT_RC_BIT,
 		SP_RESULT_FFA(FFA_BUSY), 0, 0, 0, &rc_resp, FFA_DENIED);
 
@@ -649,7 +712,7 @@
 	expect_ffa_msg_wait(&rc_resp, result);
 
 	/* Fowarding RC error as FFA_MSG_WAIT failed  */
-	expect_ffa_msg_send_direct_req(
+	expect_ffa_msg_send_direct_req_32(
 		own_id, rc_root_id, (ROUTING_EXT_RC_BIT | ROUTING_EXT_ERR_BIT),
 		result, 0, 0, 0, &resp, FFA_OK);
 
@@ -670,52 +733,52 @@
 	sp_msg sp_resp = { 0 };
 	ffa_result result = FFA_ABORTED;
 
-	fill_sp_msg(&sp_req);
+	fill_sp_msg_32(&sp_req);
 	sp_req.source_id = own_id;
 	sp_req.destination_id = rc_root_id;
 
 	req.function_id = FFA_MSG_SEND_DIRECT_REQ_32;
 	req.source_id = own_id;
 	req.destination_id = rc_root_id;
-	copy_sp_to_ffa_args(sp_req.args, req.args);
+	copy_sp_to_ffa_args_32(sp_req.args.args32, req.args.args32);
 
-	fill_ffa_msg(&rc_req);
+	fill_ffa_msg_32(&rc_req);
 	rc_req.function_id = FFA_MSG_SEND_DIRECT_RESP_32;
 	rc_req.source_id = rc_root_id;
 	rc_req.destination_id = own_id;
-	rc_req.args[0] = ROUTING_EXT_RC_BIT;
+	rc_req.args.args32[0] = ROUTING_EXT_RC_BIT;
 
-	fill_ffa_msg(&rc_resp);
+	fill_ffa_msg_32(&rc_resp);
 	rc_resp.function_id = FFA_MSG_SEND_DIRECT_REQ_32;
 	rc_resp.source_id = root_id;
 	rc_resp.destination_id = own_id;
-	rc_resp.args[0] = ROUTING_EXT_RC_BIT;
+	rc_resp.args.args32[0] = ROUTING_EXT_RC_BIT;
 
-	fill_sp_msg(&sp_resp);
+	fill_sp_msg_32(&sp_resp);
 	sp_resp.source_id = rc_root_id;
 	sp_resp.destination_id = own_id;
 
 	resp.function_id = FFA_MSG_SEND_DIRECT_RESP_32;
 	resp.source_id = rc_root_id;
 	resp.destination_id = own_id;
-	copy_sp_to_ffa_args(sp_resp.args, resp.args);
+	copy_sp_to_ffa_args_32(sp_resp.args.args32, resp.args.args32);
 
 	/* Initial request to current SP to set own_id */
 	wait_and_receive_request(root_id, own_id);
 
 	/* Sending request and receiving RC request from RC root */
-	expect_ffa_msg_send_direct_req(own_id, rc_root_id, 0, req.args[1],
-				       req.args[2], req.args[3], req.args[4],
+	expect_ffa_msg_send_direct_req_32(own_id, rc_root_id, 0, req.args.args32[1],
+				       req.args.args32[2], req.args.args32[3], req.args.args32[4],
 				       &rc_req, FFA_OK);
 
 	/* Forwarding RC request to root and receiving RC response */
-	expect_ffa_msg_send_direct_resp(own_id, root_id, rc_req.args[0],
-					rc_req.args[1], rc_req.args[2],
-					rc_req.args[3], rc_req.args[4],
+	expect_ffa_msg_send_direct_resp_32(own_id, root_id, rc_req.args.args32[0],
+					rc_req.args.args32[1], rc_req.args.args32[2],
+					rc_req.args.args32[3], rc_req.args.args32[4],
 					&rc_resp, result);
 
 	/* Fowarding RC error to RC root and receiving response */
-	expect_ffa_msg_send_direct_req(own_id, rc_root_id,
+	expect_ffa_msg_send_direct_req_32(own_id, rc_root_id,
 				       ROUTING_EXT_RC_BIT | ROUTING_EXT_ERR_BIT,
 				       SP_RESULT_FFA(result), 0, 0, 0, &resp,
 				       FFA_OK);
@@ -737,54 +800,54 @@
 	sp_msg sp_resp = { 0 };
 	ffa_result result = FFA_ABORTED;
 
-	fill_sp_msg(&sp_req);
+	fill_sp_msg_32(&sp_req);
 	sp_req.source_id = own_id;
 	sp_req.destination_id = rc_root_id;
 
 	req.function_id = FFA_MSG_SEND_DIRECT_REQ_32;
 	req.source_id = own_id;
 	req.destination_id = rc_root_id;
-	copy_sp_to_ffa_args(sp_req.args, req.args);
+	copy_sp_to_ffa_args_32(sp_req.args.args32, req.args.args32);
 
-	fill_ffa_msg(&rc_req);
+	fill_ffa_msg_32(&rc_req);
 	rc_req.function_id = FFA_MSG_SEND_DIRECT_RESP_32;
 	rc_req.source_id = rc_root_id;
 	rc_req.destination_id = own_id;
-	rc_req.args[0] = ROUTING_EXT_RC_BIT;
+	rc_req.args.args32[0] = ROUTING_EXT_RC_BIT;
 
-	fill_ffa_msg(&rc_resp);
+	fill_ffa_msg_32(&rc_resp);
 	rc_resp.function_id = FFA_MSG_SEND_DIRECT_REQ_32;
 	rc_resp.source_id = root_id;
 	rc_resp.destination_id = own_id;
-	rc_resp.args[0] = ROUTING_EXT_RC_BIT;
+	rc_resp.args.args32[0] = ROUTING_EXT_RC_BIT;
 
-	fill_sp_msg(&sp_resp);
+	fill_sp_msg_32(&sp_resp);
 	sp_resp.source_id = rc_root_id;
 	sp_resp.destination_id = own_id;
 
 	resp.function_id = FFA_MSG_SEND_DIRECT_RESP_32;
 	resp.source_id = rc_root_id;
 	resp.destination_id = own_id;
-	copy_sp_to_ffa_args(sp_resp.args, resp.args);
+	copy_sp_to_ffa_args_32(sp_resp.args.args32, resp.args.args32);
 
 	/* Initial request to current SP to set own_id */
 	wait_and_receive_request(root_id, own_id);
 
 	/* Sending request and receiving RC request from RC root */
-	expect_ffa_msg_send_direct_req(own_id, rc_root_id, 0, req.args[1],
-				       req.args[2], req.args[3], req.args[4],
+	expect_ffa_msg_send_direct_req_32(own_id, rc_root_id, 0, req.args.args32[1],
+				       req.args.args32[2], req.args.args32[3], req.args.args32[4],
 				       &rc_req, FFA_OK);
 
 	/* Forwarding RC request to root and receiving RC response */
-	expect_ffa_msg_send_direct_resp(own_id, root_id, rc_req.args[0],
-					rc_req.args[1], rc_req.args[2],
-					rc_req.args[3], rc_req.args[4],
+	expect_ffa_msg_send_direct_resp_32(own_id, root_id, rc_req.args.args32[0],
+					rc_req.args.args32[1], rc_req.args.args32[2],
+					rc_req.args.args32[3], rc_req.args.args32[4],
 					&rc_resp, FFA_OK);
 
 	/* Fowarding RC response to RC root and receiving response */
-	expect_ffa_msg_send_direct_req(own_id, rc_root_id, rc_resp.args[0],
-				       rc_resp.args[1], rc_resp.args[2],
-				       rc_resp.args[3], rc_resp.args[4], &resp,
+	expect_ffa_msg_send_direct_req_32(own_id, rc_root_id, rc_resp.args.args32[0],
+				       rc_resp.args.args32[1], rc_resp.args.args32[2],
+				       rc_resp.args.args32[3], rc_resp.args.args32[4], &resp,
 				       result);
 
 	LONGS_EQUAL(SP_RESULT_FFA(result),
@@ -812,10 +875,11 @@
 	ffa_result result = FFA_ABORTED;
 	uint32_t expected_ffa_args[5] = { 0 };
 
-	fill_sp_msg(&resp);
+	fill_sp_msg_32(&resp);
 	memset(&req, 0x5a, sizeof(req));
-	copy_sp_to_ffa_args(resp.args, expected_ffa_args);
-	expect_ffa_msg_send_direct_resp(
+	req.is_64bit_message = false;
+	copy_sp_to_ffa_args_32(resp.args.args32, expected_ffa_args);
+	expect_ffa_msg_send_direct_resp_32(
 		resp.source_id, resp.destination_id, expected_ffa_args[0],
 		expected_ffa_args[1], expected_ffa_args[2],
 		expected_ffa_args[3], expected_ffa_args[4], &ffa_msg, result);
@@ -825,14 +889,14 @@
 	MEMCMP_EQUAL(&empty_sp_msg, &req, sizeof(empty_sp_msg));
 }
 
-TEST(sp_messaging, sp_msg_send_direct_resp_msg)
+TEST(sp_messaging, sp_msg_send_direct_resp_msg_32)
 {
 	uint32_t expected_ffa_args[5] = { 0 };
 
-	fill_sp_msg(&resp);
-	fill_ffa_msg(&ffa_msg);
-	copy_sp_to_ffa_args(resp.args, expected_ffa_args);
-	expect_ffa_msg_send_direct_resp(
+	fill_sp_msg_32(&resp);
+	fill_ffa_msg_32(&ffa_msg);
+	copy_sp_to_ffa_args_32(resp.args.args32, expected_ffa_args);
+	expect_ffa_msg_send_direct_resp_32(
 		resp.source_id, resp.destination_id, expected_ffa_args[0],
 		expected_ffa_args[1], expected_ffa_args[2],
 		expected_ffa_args[3], expected_ffa_args[4], &ffa_msg, FFA_OK);
@@ -841,15 +905,32 @@
 	ffa_and_sp_msg_equal(&ffa_msg, &req);
 }
 
+TEST(sp_messaging, sp_msg_send_direct_resp_msg_64)
+{
+	uint64_t expected_ffa_args[5] = { 0 };
+
+	fill_sp_msg_64(&resp);
+	fill_ffa_msg_64(&ffa_msg);
+	copy_sp_to_ffa_args_64(resp.args.args64, expected_ffa_args);
+	expect_ffa_msg_send_direct_resp_64(
+		resp.source_id, resp.destination_id, expected_ffa_args[0],
+		expected_ffa_args[1], expected_ffa_args[2],
+		expected_ffa_args[3], expected_ffa_args[4], &ffa_msg, FFA_OK);
+
+	LONGS_EQUAL(SP_RESULT_OK, sp_msg_send_direct_resp(&resp, &req));
+	ffa_and_sp_msg_equal(&ffa_msg, &req);
+}
+
+
 TEST(sp_messaging, sp_msg_send_direct_resp_success)
 {
 	uint32_t expected_ffa_args[5] = { 0 };
 
-	fill_sp_msg(&req);
-	fill_sp_msg(&resp);
+	fill_sp_msg_32(&req);
+	fill_sp_msg_32(&resp);
 	ffa_msg.function_id = FFA_SUCCESS_32;
-	copy_sp_to_ffa_args(resp.args, expected_ffa_args);
-	expect_ffa_msg_send_direct_resp(
+	copy_sp_to_ffa_args_32(resp.args.args32, expected_ffa_args);
+	expect_ffa_msg_send_direct_resp_32(
 		resp.source_id, resp.destination_id, expected_ffa_args[0],
 		expected_ffa_args[1], expected_ffa_args[2],
 		expected_ffa_args[3], expected_ffa_args[4], &ffa_msg, FFA_OK);
@@ -864,20 +945,20 @@
 	uint32_t expected_ffa_args[5] = { 0 };
 	struct ffa_direct_msg rc_msg = { 0 };
 
-	fill_sp_msg(&resp);
+	fill_sp_msg_32(&resp);
 
-	fill_ffa_msg(&rc_msg);
-	rc_msg.args[0] = ROUTING_EXT_RC_BIT;
+	fill_ffa_msg_32(&rc_msg);
+	rc_msg.args.args32[0] = ROUTING_EXT_RC_BIT;
 
-	fill_ffa_msg(&ffa_msg);
-	copy_sp_to_ffa_args(resp.args, expected_ffa_args);
+	fill_ffa_msg_32(&ffa_msg);
+	copy_sp_to_ffa_args_32(resp.args.args32, expected_ffa_args);
 
-	expect_ffa_msg_send_direct_resp(
+	expect_ffa_msg_send_direct_resp_32(
 		resp.source_id, resp.destination_id, expected_ffa_args[0],
 		expected_ffa_args[1], expected_ffa_args[2],
 		expected_ffa_args[3], expected_ffa_args[4], &rc_msg, FFA_OK);
 
-	expect_ffa_msg_send_direct_resp(
+	expect_ffa_msg_send_direct_resp_32(
 		rc_msg.destination_id, rc_msg.source_id,
 		ROUTING_EXT_RC_BIT | ROUTING_EXT_ERR_BIT,
 		SP_RESULT_FFA(FFA_DENIED), 0, 0, 0, &ffa_msg, result);
@@ -892,21 +973,21 @@
 	uint32_t expected_ffa_args[5] = { 0 };
 	struct ffa_direct_msg rc_msg = { 0 };
 
-	fill_sp_msg(&resp);
+	fill_sp_msg_32(&resp);
 
-	fill_ffa_msg(&rc_msg);
-	rc_msg.args[0] = ROUTING_EXT_RC_BIT;
+	fill_ffa_msg_32(&rc_msg);
+	rc_msg.args.args32[0] = ROUTING_EXT_RC_BIT;
 
-	fill_ffa_msg(&ffa_msg);
-	copy_sp_to_ffa_args(resp.args, expected_ffa_args);
+	fill_ffa_msg_32(&ffa_msg);
+	copy_sp_to_ffa_args_32(resp.args.args32, expected_ffa_args);
 
-	expect_ffa_msg_send_direct_resp(resp.source_id, resp.destination_id, 0,
+	expect_ffa_msg_send_direct_resp_32(resp.source_id, resp.destination_id, 0,
 					expected_ffa_args[1],
 					expected_ffa_args[2],
 					expected_ffa_args[3],
 					expected_ffa_args[4], &rc_msg, FFA_OK);
 
-	expect_ffa_msg_send_direct_resp(
+	expect_ffa_msg_send_direct_resp_32(
 		rc_msg.destination_id, rc_msg.source_id,
 		ROUTING_EXT_RC_BIT | ROUTING_EXT_ERR_BIT,
 		SP_RESULT_FFA(FFA_DENIED), 0, 0, 0, &ffa_msg, FFA_OK);
@@ -933,13 +1014,14 @@
 {
 	ffa_result result = FFA_ABORTED;
 
-	fill_sp_msg(&resp);
+	fill_sp_msg_32(&resp);
 	memset(&req, 0x5a, sizeof(req));
-	fill_ffa_msg(&ffa_msg);
+	req.is_64bit_message = false;
+	fill_ffa_msg_32(&ffa_msg);
 
-	expect_ffa_msg_send_direct_resp(req.source_id, req.destination_id,
-					ROUTING_EXT_RC_BIT, req.args[0],
-					req.args[1], req.args[2], req.args[3],
+	expect_ffa_msg_send_direct_resp_32(req.source_id, req.destination_id,
+					ROUTING_EXT_RC_BIT, req.args.args32[0],
+					req.args.args32[1], req.args.args32[2], req.args.args32[3],
 					&ffa_msg, result);
 
 	LONGS_EQUAL(SP_RESULT_FFA(result), sp_msg_send_rc_req(&req, &resp));
@@ -953,22 +1035,22 @@
 
 	wait_and_receive_request(root_id, own_id);
 
-	fill_sp_msg(&req);
+	fill_sp_msg_32(&req);
 	req.source_id = own_id;
 	req.destination_id = root_id;
 
-	fill_ffa_msg(&ffa_msg);
+	fill_ffa_msg_32(&ffa_msg);
 	ffa_msg.source_id = root_id;
 	ffa_msg.destination_id = own_id;
 	/* Should be RC message so it will be denied */
-	ffa_msg.args[0] = 0;
+	ffa_msg.args.args32[0] = 0;
 
-	expect_ffa_msg_send_direct_resp(req.source_id, req.destination_id,
-					ROUTING_EXT_RC_BIT, req.args[0],
-					req.args[1], req.args[2], req.args[3],
+	expect_ffa_msg_send_direct_resp_32(req.source_id, req.destination_id,
+					ROUTING_EXT_RC_BIT, req.args.args32[0],
+					req.args.args32[1], req.args.args32[2], req.args.args32[3],
 					&ffa_msg, FFA_OK);
 
-	expect_ffa_msg_send_direct_resp(
+	expect_ffa_msg_send_direct_resp_32(
 		req.source_id, req.destination_id,
 		ROUTING_EXT_RC_BIT | ROUTING_EXT_ERR_BIT,
 		SP_RESULT_FFA(FFA_BUSY), 0, 0, 0, &ffa_msg, result);
@@ -987,19 +1069,19 @@
 
 	wait_and_receive_request(root_id, own_id);
 
-	fill_sp_msg(&req);
+	fill_sp_msg_32(&req);
 	req.source_id = own_id;
 	req.destination_id = root_id;
 
-	fill_ffa_msg(&ffa_msg);
+	fill_ffa_msg_32(&ffa_msg);
 	ffa_msg.source_id = root_id;
 	ffa_msg.destination_id = own_id;
-	ffa_msg.args[0] = ROUTING_EXT_RC_BIT | ROUTING_EXT_ERR_BIT;
-	ffa_msg.args[1] = sp_err;
+	ffa_msg.args.args32[0] = ROUTING_EXT_RC_BIT | ROUTING_EXT_ERR_BIT;
+	ffa_msg.args.args32[1] = sp_err;
 
-	expect_ffa_msg_send_direct_resp(req.source_id, req.destination_id,
-					ROUTING_EXT_RC_BIT, req.args[0],
-					req.args[1], req.args[2], req.args[3],
+	expect_ffa_msg_send_direct_resp_32(req.source_id, req.destination_id,
+					ROUTING_EXT_RC_BIT, req.args.args32[0],
+					req.args.args32[1], req.args.args32[2], req.args.args32[3],
 					&ffa_msg, FFA_OK);
 
 	LONGS_EQUAL(sp_err, sp_msg_send_rc_req(&req, &resp));
@@ -1013,18 +1095,18 @@
 
 	wait_and_receive_request(root_id, own_id);
 
-	fill_sp_msg(&req);
+	fill_sp_msg_32(&req);
 	req.source_id = own_id;
 	req.destination_id = root_id;
 
-	fill_ffa_msg(&ffa_msg);
+	fill_ffa_msg_32(&ffa_msg);
 	ffa_msg.source_id = root_id;
 	ffa_msg.destination_id = own_id;
-	ffa_msg.args[0] = ROUTING_EXT_RC_BIT;
+	ffa_msg.args.args32[0] = ROUTING_EXT_RC_BIT;
 
-	expect_ffa_msg_send_direct_resp(req.source_id, req.destination_id,
-					ROUTING_EXT_RC_BIT, req.args[0],
-					req.args[1], req.args[2], req.args[3],
+	expect_ffa_msg_send_direct_resp_32(req.source_id, req.destination_id,
+					ROUTING_EXT_RC_BIT, req.args.args32[0],
+					req.args.args32[1], req.args.args32[2], req.args.args32[3],
 					&ffa_msg, FFA_OK);
 
 	LONGS_EQUAL(SP_RESULT_OK, sp_msg_send_rc_req(&req, &resp));