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/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)) {