feat: initial support for FFA_ABORT ABI to abort partition
This patch adds initial support for the newly introduced FFA_ABORT ABI.
It is invoked by partition, to enter aborted state, when it encounters
a fatal error.
Subsequent patches will add incremental support for handling this ABI by
partition manager.
Change-Id: I601a0bf4efd61f5008285b6712107795c65c0332
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
diff --git a/src/ffa/hypervisor/cpu_cycles.c b/src/ffa/hypervisor/cpu_cycles.c
index cf9f4bb..5ec1a45 100644
--- a/src/ffa/hypervisor/cpu_cycles.c
+++ b/src/ffa/hypervisor/cpu_cycles.c
@@ -10,6 +10,7 @@
#include "hf/api.h"
#include "hf/ffa/indirect_messaging.h"
+#include "hf/ffa/vm.h"
#include "hf/ffa_internal.h"
#include "hf/vcpu.h"
@@ -137,3 +138,14 @@
/* TODO: Interface not handled in hypervisor. */
return ffa_error(FFA_NOT_SUPPORTED);
}
+
+struct ffa_value ffa_cpu_cycles_abort(struct vcpu_locked *current_locked,
+ struct vcpu **next)
+{
+ struct ffa_value to_ret = ffa_error(FFA_ABORTED);
+
+ *next = api_switch_to_primary(*current_locked, to_ret,
+ VCPU_STATE_ABORTED);
+
+ return (struct ffa_value){.func = FFA_SUCCESS_32};
+}