fix: simplify secure interrupt handling
Now that hafnium supports queueing of virtual interrupts for each
execution context of an SP, there is no need to disallow high priority
interrupts from preempting a vCPU while it is handling a virtual
interrupt.
Hence, remove the actions of masking and unmasking physical interrupts
before/after vCPU is run.
Arm recommends the priority for G1 non-secure interrupts to be in the
range 0x80 to 0xff when programming from secure world. Currently, the
SRI priority is incorrect. This patch also fixes the priority value.
Change-Id: Icdc36f3aa09fab83cb58214e14e5a9bd174bc28b
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
diff --git a/src/arch/aarch64/hypervisor/handler.c b/src/arch/aarch64/hypervisor/handler.c
index 53ab23f..71d4d1e 100644
--- a/src/arch/aarch64/hypervisor/handler.c
+++ b/src/arch/aarch64/hypervisor/handler.c
@@ -1166,11 +1166,14 @@
if (plat_ffa_vm_managed_exit_supported(current_vcpu->vm)) {
uint8_t pmr = plat_interrupts_get_priority_mask();
- /* Mask all interrupts */
- plat_interrupts_set_priority_mask(0x0);
+ /*
+ * Mask non-secure interrupt from triggering again till the
+ * vCPU completes the managed exit sequenece.
+ */
+ plat_interrupts_set_priority_mask(SWD_MASK_NS_INT);
current_locked = vcpu_lock(current_vcpu);
- current_vcpu->priority_mask = pmr;
+ current_vcpu->prev_interrupt_priority = pmr;
ret = api_interrupt_inject_locked(current_locked,
HF_MANAGED_EXIT_INTID,
current_locked, NULL);