feat(memory share): FFA_FEATURES(FFA_MEM_RETRIEVE_REQ)
Table 13.14 in the FF-A v.1.1 REL0 specification requires bits 31:2
and bit 0 of the input parameter to be 0 (MBZ) when querying
`FFA_FEATURES` for `FFA_MEM_RETRIEVE_REQ`.
It also requires that the return parameter must report support for
dynamically allocated buffers (bit 0), support for the NS bit (bit 1),
and support for retrieval by the hypervisor (bit 2).
This patch modifies `api_ffa_features` to validate the input parameters
and report feature support when the function id is
`FFA_MEM_RETRIEVE_REQ`
Signed-off-by: Karl Meakin <karl.meakin@arm.com>
Change-Id: Ie415083ba0e5cd506a1162ff9649e3e188e83737
diff --git a/inc/vmapi/hf/call.h b/inc/vmapi/hf/call.h
index 4776421..602b147 100644
--- a/inc/vmapi/hf/call.h
+++ b/inc/vmapi/hf/call.h
@@ -442,10 +442,29 @@
* - FFA_ERROR in .func if the optional interface with function_id is not
* implemented.
*/
-static inline struct ffa_value ffa_features(uint32_t function_id)
+static inline struct ffa_value ffa_features(uint64_t function_id)
{
- return ffa_call((struct ffa_value){.func = FFA_FEATURES_32,
- .arg1 = function_id});
+ return ffa_call((struct ffa_value){
+ .func = FFA_FEATURES_32,
+ .arg1 = function_id,
+ });
+}
+
+/**
+ * Discovery function returning information about the implementation of optional
+ * FF-A interfaces which require an extra input property
+ *
+ * Returns:
+ * - FFA_SUCCESS in .func if the optional interface with function_id is
+ * implemented.
+ * - FFA_ERROR in .func if the optional interface with function_id is not
+ * implemented.
+ */
+static inline struct ffa_value ffa_features_with_input_property(
+ uint64_t function_id, uint64_t param)
+{
+ return ffa_call((struct ffa_value){
+ .func = FFA_FEATURES_32, .arg1 = function_id, .arg2 = param});
}
static inline struct ffa_value ffa_msg_send_direct_req(