feat(interrupts): add FFA_EL3_INTR_HANDLE support
This patch introduces initial support for FFA_EL3_INTR_HANDLE ABI.
This ABI allows SPMC to delegate Group0 secure interrupt handling to
EL3 firmware (SPMD).
Complete support for this ABI is added in upcoming patches.
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
Change-Id: I1a75cfe87029fc32a0e6ddbe36ae3fe195ff3d84
diff --git a/inc/vmapi/hf/ffa.h b/inc/vmapi/hf/ffa.h
index 5717aa6..c9b947c 100644
--- a/inc/vmapi/hf/ffa.h
+++ b/inc/vmapi/hf/ffa.h
@@ -84,6 +84,7 @@
#define FFA_CONSOLE_LOG_32 0x8400008A
#define FFA_CONSOLE_LOG_64 0xC400008A
#define FFA_PARTITION_INFO_GET_REGS_64 0xC400008B
+#define FFA_EL3_INTR_HANDLE_32 0x8400008C
/* FF-A error codes. */
#define FFA_NOT_SUPPORTED INT32_C(-1)
diff --git a/src/arch/aarch64/hypervisor/handler.c b/src/arch/aarch64/hypervisor/handler.c
index 0146ad5..3ef7546 100644
--- a/src/arch/aarch64/hypervisor/handler.c
+++ b/src/arch/aarch64/hypervisor/handler.c
@@ -9,6 +9,7 @@
#include <stdnoreturn.h>
#include "hf/arch/barriers.h"
+#include "hf/arch/gicv3.h"
#include "hf/arch/init.h"
#include "hf/arch/mmu.h"
#include "hf/arch/plat/ffa.h"
@@ -1085,7 +1086,23 @@
struct vcpu_locked current_locked;
struct vcpu *current_vcpu = current();
int64_t ret;
+ uint32_t intid;
+ intid = get_highest_pending_g0_interrupt_id();
+
+ /* Check for the highest priority pending Group0 interrupt. */
+ if (intid != SPURIOUS_INTID_OTHER_WORLD) {
+ /*
+ * TODO: Delegate handling of Group0 interrupt to EL3 firmware.
+ */
+ panic();
+ }
+
+ /*
+ * A special interrupt indicating there is no pending interrupt
+ * with sufficient priority for current security state. This
+ * means a non-secure interrupt is pending.
+ */
assert(current_vcpu->vm->ns_interrupts_action != NS_ACTION_QUEUED);
if (plat_ffa_vm_managed_exit_supported(current_vcpu->vm)) {