Provide support for FIQ interrupts
This patch introduces support for FIQ virtual interrupts by adding
an "interrupt type" configuration for each INTID.
Following changes are done:
- Helpers added to inject a virtual FIQ by setting HCR_EL2.VF
- hf_interrupt_enable hypervisor call updated with a new
"interrupt type" argument
Nominally, we intend to signal an NS interrupt to a SP as a virtual FIQ
using GICv3. The same interrupt can be signaled as a virtual IRQ if such
option is passed in the Hafnium interrupt enable call.
The reasoning is to ease migration of TEEs relying on receiving physical
Group1 NS/Group0 interrupts as FIQ (or foreign interrupts).
The same TEE now running as a Secure Partition receives a virtual FIQ
for a NS interrupt (or Group0 interrupt).
As mentioned above, there is also the flexibility to receive all
interrupts (Group1 S/Group1 NS/Group0) to the same vIRQ vector.
Change-Id: I78daf1ae226ea9cc01f65da36ae31ed9fff84f42
Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
diff --git a/inc/vmapi/hf/call.h b/inc/vmapi/hf/call.h
index 900a74e..b8a07da 100644
--- a/inc/vmapi/hf/call.h
+++ b/inc/vmapi/hf/call.h
@@ -285,9 +285,10 @@
*
* Returns 0 on success, or -1 if the intid is invalid.
*/
-static inline int64_t hf_interrupt_enable(uint32_t intid, bool enable)
+static inline int64_t hf_interrupt_enable(uint32_t intid, bool enable,
+ enum interrupt_type type)
{
- return hf_call(HF_INTERRUPT_ENABLE, intid, enable, 0);
+ return hf_call(HF_INTERRUPT_ENABLE, intid, enable, type);
}
/**
diff --git a/inc/vmapi/hf/types.h b/inc/vmapi/hf/types.h
index fa5128e..54bf2c7 100644
--- a/inc/vmapi/hf/types.h
+++ b/inc/vmapi/hf/types.h
@@ -51,3 +51,9 @@
/** The virtual interrupt ID used for the virtual timer. */
#define HF_VIRTUAL_TIMER_INTID 3
+
+/** Type of interrupts */
+enum interrupt_type {
+ INTERRUPT_TYPE_IRQ,
+ INTERRUPT_TYPE_FIQ,
+};