feat: FFA_FEATURES update for FF-A v1.1 features
Update to handling of FFA_FEATURES to encompass:
- Notifications func IDs.
- Query of interrupt IDs for Schedule Receiver Interrupt, Notification
Pending Interrupt, and Managed Exit Interrupt.
- Tests to FFA_FEATURES to validate aforementioned points.
Change-Id: If6810ea222ce30e40ab0d004e3631ca9fae316a8
Signed-off-by: J-Alves <joao.alves@arm.com>
diff --git a/inc/hf/api.h b/inc/hf/api.h
index b31d7b5..aae2298 100644
--- a/inc/hf/api.h
+++ b/inc/hf/api.h
@@ -61,6 +61,7 @@
const struct ffa_uuid *uuid);
struct ffa_value api_ffa_id_get(const struct vcpu *current);
struct ffa_value api_ffa_spm_id_get(void);
+struct ffa_value api_ffa_feature_success(uint32_t arg2);
struct ffa_value api_ffa_features(uint32_t function_id);
struct ffa_value api_ffa_run(ffa_vm_id_t vm_id, ffa_vcpu_index_t vcpu_idx,
struct vcpu *current, struct vcpu **next);
diff --git a/inc/hf/arch/plat/ffa.h b/inc/hf/arch/plat/ffa.h
index 8ce3d10..99e9f6f 100644
--- a/inc/hf/arch/plat/ffa.h
+++ b/inc/hf/arch/plat/ffa.h
@@ -51,7 +51,7 @@
};
/** Returns information on features that are specific to the platform. */
-struct ffa_value plat_ffa_features(uint32_t function_id);
+struct ffa_value plat_ffa_features(uint32_t function_feature_id);
/** Returns the SPMC ID. */
struct ffa_value plat_ffa_spmc_id_get(void);
diff --git a/inc/vmapi/hf/ffa.h b/inc/vmapi/hf/ffa.h
index f3d9d15..903bb3e 100644
--- a/inc/vmapi/hf/ffa.h
+++ b/inc/vmapi/hf/ffa.h
@@ -93,6 +93,24 @@
/* clang-format on */
+/**
+ * FF-A Feature ID, to be used with interface FFA_FEATURES.
+ * As defined in the FF-A v1.1 Beta specification, table 13.10, in section
+ * 13.2.
+ */
+
+#define FFA_FEATURES_FUNC_ID_MASK UINT32_C(0x1 << 31)
+#define FFA_FEATURES_FEATURE_ID_MASK UINT32_C(0x7F)
+
+/* Query interrupt ID of Notification Pending Interrupt. */
+#define FFA_FEATURE_NPI 0x1U
+
+/* Query interrupt ID of Schedule Receiver Interrupt. */
+#define FFA_FEATURE_SRI 0x2U
+
+/* Query interrupt ID of the Managed Exit Interrupt. */
+#define FFA_FEATURE_MEI 0x3U
+
/* FF-A function specific constants. */
#define FFA_MSG_RECV_BLOCK 0x1
#define FFA_MSG_RECV_BLOCK_MASK 0x1
@@ -330,6 +348,11 @@
return (args.arg4 >> 16) & 0xffff;
}
+static inline uint32_t ffa_feature_intid(struct ffa_value args)
+{
+ return (uint32_t)args.arg2;
+}
+
/**
* Holds the UUID in a struct that is mappable directly to the SMCC calling
* convention, which is used for FF-A calls.
@@ -405,8 +428,6 @@
#define MAX_FFA_NOTIFICATIONS 64U
-#define FFA_SCHEDULE_RECEIVER_INTERRUPT_ID 8
-
/**
* Flag for notification bind and set, to specify call is about per-vCPU
* notifications.
diff --git a/inc/vmapi/hf/types.h b/inc/vmapi/hf/types.h
index f611bc9..d8a9e3f 100644
--- a/inc/vmapi/hf/types.h
+++ b/inc/vmapi/hf/types.h
@@ -55,8 +55,11 @@
/** The virtual interrupt ID used for managed exit. */
#define HF_MANAGED_EXIT_INTID 4
-/** The virtual interrupt ID used for notification pending interrupt */
-#define HF_NOTIFICATION_PENDING_INTERRUPT_INTID 5
+/** The virtual interrupt ID used for notification pending interrupt. */
+#define HF_NOTIFICATION_PENDING_INTID 5
+
+/** The physical interrupt ID use for the schedule receiver interrupt. */
+#define HF_SCHEDULE_RECEIVER_INTID 8
/** Type of interrupts */
enum interrupt_type {