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/ffa.h b/inc/vmapi/hf/ffa.h
index 4db2c14..5717aa6 100644
--- a/inc/vmapi/hf/ffa.h
+++ b/inc/vmapi/hf/ffa.h
@@ -107,6 +107,21 @@
#define FFA_FEATURES_FUNC_ID_MASK (UINT32_C(1) << 31)
#define FFA_FEATURES_FEATURE_ID_MASK UINT32_C(0x7F)
+/**
+ * Defined in Table 13.14 in the FF-A v.1.1 REL0 specification.
+ * Bits[31:2] and Bit[0] of input are reserved (must be zero).
+ * Bit[0]: dynamically allocated buffer support.
+ * Bit[1]: NS bit handling.
+ * Bit[2]: support for retrieval by hypervisor.
+ */
+#define FFA_FEATURES_MEM_RETRIEVE_REQ_BUFFER_SUPPORT 0
+#define FFA_FEATURES_MEM_RETRIEVE_REQ_NS_SUPPORT (UINT32_C(1) << 1)
+#define FFA_FEATURES_MEM_RETRIEVE_REQ_HYPERVISOR_SUPPORT (UINT32_C(1) << 2)
+#define FFA_FEATURES_MEM_RETRIEVE_REQ_MBZ_MASK \
+ (~(FFA_FEATURES_MEM_RETRIEVE_REQ_BUFFER_SUPPORT | \
+ FFA_FEATURES_MEM_RETRIEVE_REQ_NS_SUPPORT | \
+ FFA_FEATURES_MEM_RETRIEVE_REQ_HYPERVISOR_SUPPORT))
+
/* Query interrupt ID of Notification Pending Interrupt. */
#define FFA_FEATURE_NPI 0x1U