fix(ff-a): use messaging info from the manifest
Adds a messaging method to the VM structure. Refactor messaging info
field in the manifest to comply with information in specification. In
particular - distinguish between the direct message send/receive.
Use messaging method from the manifest to populate partition info for
FFA_PARTITION_INFO_GET ABI. Populates partition info based on the
caller id (SP can send direct messages to other SPs).
Refactors managed exit check to use messaging method value.
Signed-off-by: Maksims Svecovs <maksims.svecovs@arm.com>
Change-Id: Id0734c18d14879b89ba3517b8ff4b3b41b53b56f
diff --git a/inc/hf/arch/plat/ffa.h b/inc/hf/arch/plat/ffa.h
index e300ade..bfbc049 100644
--- a/inc/hf/arch/plat/ffa.h
+++ b/inc/hf/arch/plat/ffa.h
@@ -37,3 +37,9 @@
*/
bool plat_ffa_memory_handle_allocated_by_current_world(
ffa_memory_handle_t handle);
+
+/**
+ * Return the FF-A partition info VM/SP properties given the VM id.
+ */
+ffa_partition_properties_t plat_ffa_partition_properties(
+ ffa_vm_id_t current_id, const struct vm *target);
diff --git a/inc/hf/arch/vm.h b/inc/hf/arch/vm.h
index a236ab4..937a17f 100644
--- a/inc/hf/arch/vm.h
+++ b/inc/hf/arch/vm.h
@@ -14,8 +14,3 @@
* Set architecture-specific features for the specified VM.
*/
void arch_vm_features_set(struct vm *vm);
-
-/**
- * Return the FF-A partition info VM/SP properties given the VM id.
- */
-ffa_partition_properties_t arch_vm_partition_properties(ffa_vm_id_t id);
diff --git a/inc/hf/manifest.h b/inc/hf/manifest.h
index 8a01883..f9a899b 100644
--- a/inc/hf/manifest.h
+++ b/inc/hf/manifest.h
@@ -45,14 +45,6 @@
enum xlat_granule { PAGE_4KB = 0, PAGE_16KB, PAGE_64KB };
-enum messaging_method {
- DIRECT_MESSAGING = 0,
- INDIRECT_MESSAGING,
- BOTH_MESSAGING,
- DIRECT_MESSAGING_MANAGED_EXIT,
- BOTH_MESSAGING_MANAGED_EXIT
-};
-
/**
* Partition Memory region as described in PSA FFA v1.0 spec, Table 10
*/
@@ -145,7 +137,7 @@
struct rx_tx rxtx;
/** mandatory - direct/indirect msg or both */
- enum messaging_method messaging_method;
+ uint8_t messaging_method;
/** optional */
bool has_primary_scheduler;
/** optional - preemptible / run to completion */
diff --git a/inc/hf/vm.h b/inc/hf/vm.h
index c40b2e8..8d2ac07 100644
--- a/inc/hf/vm.h
+++ b/inc/hf/vm.h
@@ -125,7 +125,7 @@
*/
bool initialized;
uint16_t boot_order;
- bool supports_managed_exit;
+ uint8_t messaging_method;
struct vm *next_boot;
/**
@@ -176,3 +176,4 @@
void vm_update_boot(struct vm *vm);
struct vm *vm_get_first_boot(void);
+bool vm_managed_exit_supported(struct vm *vm);