feat(notifications): schedule receiver interrupt
Configuring Schedule Receiver Interrupt for each CPU, and send
respective SGI to the NWd. If flag FFA_NOTIFICATIONS_FLAG_DELAY_SRI
is set, the SGI will be sent upon context switch from the SWd to the NWd
else it will be sent immediately, the sender SP execution will be
preempted.
A state machine was implemented to coordinate handling and sending of
the SRI.
Change-Id: If05a6535094f5da7189d8dbb55b04e7c1a1f80d7
Signed-off-by: J-Alves <joao.alves@arm.com>
diff --git a/src/arch/aarch64/hypervisor/handler.c b/src/arch/aarch64/hypervisor/handler.c
index d038ef3..a5f32cf 100644
--- a/src/arch/aarch64/hypervisor/handler.c
+++ b/src/arch/aarch64/hypervisor/handler.c
@@ -726,6 +726,16 @@
#endif
if (ffa_handler(&args, vcpu, next)) {
+#if SECURE_WORLD == 1
+ /*
+ * If giving back execution to the NWd, check if the Schedule
+ * Receiver Interrupt has been delayed, and trigger it if so.
+ */
+ if ((*next != NULL && (*next)->vm->id == HF_OTHER_WORLD_ID) ||
+ (*next == NULL && vcpu->vm->id == HF_OTHER_WORLD_ID)) {
+ plat_ffa_sri_trigger_if_delayed(vcpu->cpu);
+ }
+#endif
arch_regs_set_retval(&vcpu->regs, args);
vcpu_update_virtual_interrupts(*next);
return true;