feat(interrupts): new interrupt deactivation ABI
This patch introduces a new FF-A paravirtualized ABI for interrupt
deactivation.
This is needed for support of secure interrupt managment in SPM. The
current iteration of secure interrupt handling is implemented on the
basis of para-virtualized GIC interfaces.
Secure Partitions leverage hvc calls that are handled by these
para-virtualized ABIs to handle interrupts such as performing end-of-
interrupt. At the moment, Secure Partitions may not have support of
GIC driver for accessing CPU interface registers themselves.
In the future, we plan to add support for GIC driver in the Secure
Partitions as well as support for Interrupt Virtualization in GICv3.
It is built on the hardware support available in GICv3 implementation
which use hardware list registers for virtual interrupt state/priority
management.
Change-Id: Iae0c273b92d0793a4d3e03e22fd477d18100f0c1
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
diff --git a/inc/hf/arch/plat/ffa.h b/inc/hf/arch/plat/ffa.h
index 2462aac..4e17c02 100644
--- a/inc/hf/arch/plat/ffa.h
+++ b/inc/hf/arch/plat/ffa.h
@@ -142,3 +142,9 @@
*/
bool plat_ffa_run_checks(struct vcpu *current, ffa_vm_id_t target_vm_id,
struct ffa_value *run_ret, struct vcpu **next);
+
+/**
+ * Deactivate interrupt.
+ */
+int64_t plat_ffa_interrupt_deactivate(uint32_t pint_id, uint32_t vint_id,
+ struct vcpu *current);
diff --git a/inc/hf/vcpu.h b/inc/hf/vcpu.h
index e7dd9f0..9f77455 100644
--- a/inc/hf/vcpu.h
+++ b/inc/hf/vcpu.h
@@ -103,6 +103,23 @@
/** Determine whether partition is currently handling managed exit. */
bool processing_managed_exit;
+
+ /**
+ * Determine whether vCPU is currently handling secure interrupt.
+ */
+ bool processing_secure_interrupt;
+ bool secure_interrupt_deactivated;
+
+ /**
+ * INTID of the current secure interrupt being processed by this vCPU.
+ */
+ uint32_t current_sec_interrupt_id;
+
+ /**
+ * Track current vCPU which got pre-empted when secure interrupt
+ * triggered.
+ */
+ struct vcpu *preempted_vcpu;
};
/** Encapsulates a vCPU whose lock is held. */
diff --git a/inc/vmapi/hf/abi.h b/inc/vmapi/hf/abi.h
index e23061c..73f482a 100644
--- a/inc/vmapi/hf/abi.h
+++ b/inc/vmapi/hf/abi.h
@@ -20,6 +20,7 @@
#define HF_INTERRUPT_ENABLE 0xff03
#define HF_INTERRUPT_GET 0xff04
#define HF_INTERRUPT_INJECT 0xff05
+#define HF_INTERRUPT_DEACTIVATE 0xff08
/* Custom FF-A-like calls returned from FFA_RUN. */
#define HF_FFA_RUN_WAIT_FOR_INTERRUPT 0xff06