feat: allow an SP to yield while handling secure interrupt
An SP could be scheduled by the SPMC in response to a secure
interrupt. FF-A v1.2 spec allows SP to yield the CPU cycles before
completing the secure interrupt handling.
In the current implementation, SPMC treats this invocation as a no-op
and immediately resumes the execution context.
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
Change-Id: I23bc6fe911998b951eed1ada363529b10661eeca
diff --git a/src/api.c b/src/api.c
index 89c0332..7b1fa0a 100644
--- a/src/api.c
+++ b/src/api.c
@@ -311,6 +311,14 @@
return ffa_error(FFA_DENIED);
}
+ /*
+ * The current vCPU is expected to move to BLOCKED state. However,
+ * under certain circumstances, it is allowed for the current vCPU
+ * to be resumed immediately without ever moving to BLOCKED state. One
+ * such scenario occurs when an SP's execution context attempts to
+ * yield cycles while handling secure interrupt. Refer to the comments
+ * in the SPMC variant of the plat_ffa_yield_prepare function.
+ */
assert(next_state == VCPU_STATE_BLOCKED);
return plat_ffa_yield_prepare(current, next, timeout_low, timeout_high);