Browse Source

fix(spmd): perform G0 interrupt acknowledge and deactivation

Prior to delegating handling of Group0 secure interrupt to platform
handler, SPMD framework must acknowledge the highest pending interrupt.
Moreover, once the platform has handled the interrupt successfully,
SPMD must deactivate the interrupt.

The rationale behind this decision is SPMD framework is well suited to
perform interrupt management at GIC boundary while the platform handler
is well equipped to deal with the device interface related to the
interrupt.

This patch also fixes a bug in the error code returned upon invocation
of FFA_EL3_INTR_HANDLE from normal world.

Change-Id: If8fef51899e25f966038cc01ec58c84ee25e88eb
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
pull/2000/head
Madhukar Pappireddy 1 year ago
parent
commit
6c91fc4458
  1. 3
      plat/arm/board/tc/tc_bl31_setup.c
  2. 12
      services/std_svc/spmd/spmd_main.c

3
plat/arm/board/tc/tc_bl31_setup.c

@ -120,12 +120,9 @@ int plat_spmd_handle_group0_interrupt(uint32_t intid)
{
/* Trusted Watchdog timer is the only source of Group0 interrupt now. */
if (intid == SBSA_SECURE_WDOG_INTID) {
INFO("Watchdog restarted\n");
/* Refresh the timer. */
plat_arm_secure_wdt_refresh();
/* Deactivate the corresponding interrupt. */
plat_ic_end_of_interrupt(intid);
return 0;
}

12
services/std_svc/spmd/spmd_main.c

@ -273,13 +273,16 @@ static uint64_t spmd_group0_interrupt_handler_nwd(uint32_t id,
assert(plat_ic_get_pending_interrupt_type() == INTR_TYPE_EL3);
intid = plat_ic_get_pending_interrupt_id();
intid = plat_ic_acknowledge_interrupt();
if (plat_spmd_handle_group0_interrupt(intid) < 0) {
ERROR("Group0 interrupt %u not handled\n", intid);
panic();
}
/* Deactivate the corresponding Group0 interrupt. */
plat_ic_end_of_interrupt(intid);
return 0U;
}
#endif
@ -300,7 +303,7 @@ static uint64_t spmd_handle_group0_intr_swd(void *handle)
assert(plat_ic_get_pending_interrupt_type() == INTR_TYPE_EL3);
intid = plat_ic_get_pending_interrupt_id();
intid = plat_ic_acknowledge_interrupt();
/*
* TODO: Currently due to a limitation in SPMD implementation, the
@ -313,6 +316,9 @@ static uint64_t spmd_handle_group0_intr_swd(void *handle)
panic();
}
/* Deactivate the corresponding Group0 interrupt. */
plat_ic_end_of_interrupt(intid);
/* Return success. */
SMC_RET8(handle, FFA_SUCCESS_SMC32, FFA_PARAM_MBZ, FFA_PARAM_MBZ,
FFA_PARAM_MBZ, FFA_PARAM_MBZ, FFA_PARAM_MBZ, FFA_PARAM_MBZ,
@ -1187,7 +1193,7 @@ uint64_t spmd_smc_handler(uint32_t smc_fid,
if (secure_origin) {
return spmd_handle_group0_intr_swd(handle);
} else {
return spmd_ffa_error_return(handle, FFA_ERROR_DENIED);
return spmd_ffa_error_return(handle, FFA_ERROR_NOT_SUPPORTED);
}
default:
WARN("SPM: Unsupported call 0x%08x\n", smc_fid);

Loading…
Cancel
Save