Merge "feat(el3-spmc): use spmd_smc_switch_state after secure interrupt" into integration

This commit is contained in:
Madhukar Pappireddy 2025-01-29 00:46:06 +01:00 committed by TrustedFirmware Code Review
commit eb2215d2e7
2 changed files with 8 additions and 9 deletions

View file

@ -659,19 +659,14 @@ static uint64_t msg_wait_handler(uint32_t smc_fid,
/* Resume normal world if a secure interrupt was handled. */ /* Resume normal world if a secure interrupt was handled. */
if (sp->ec[idx].rt_model == RT_MODEL_INTR) { if (sp->ec[idx].rt_model == RT_MODEL_INTR) {
/* FFA_MSG_WAIT can only be called from the secure world. */
unsigned int secure_state_in = SECURE;
unsigned int secure_state_out = NON_SECURE;
cm_el1_sysregs_context_save(secure_state_in);
cm_el1_sysregs_context_restore(secure_state_out);
cm_set_next_eret_context(secure_state_out);
if (sp->runtime_el == S_EL0) { if (sp->runtime_el == S_EL0) {
spin_unlock(&sp->rt_state_lock); spin_unlock(&sp->rt_state_lock);
} }
SMC_RET0(cm_get_context(secure_state_out)); return spmd_smc_switch_state(FFA_NORMAL_WORLD_RESUME, secure_origin,
FFA_PARAM_MBZ, FFA_PARAM_MBZ,
FFA_PARAM_MBZ, FFA_PARAM_MBZ,
handle, flags);
} }
/* Protect the runtime state of a S-EL0 SP with a lock. */ /* Protect the runtime state of a S-EL0 SP with a lock. */

View file

@ -715,6 +715,10 @@ uint64_t spmd_smc_switch_state(uint32_t smc_fid,
cm_set_next_eret_context(secure_state_out); cm_set_next_eret_context(secure_state_out);
ctx_out = cm_get_context(secure_state_out); ctx_out = cm_get_context(secure_state_out);
if (smc_fid == FFA_NORMAL_WORLD_RESUME) {
SMC_RET0(ctx_out);
}
#if SPMD_SPM_AT_SEL2 #if SPMD_SPM_AT_SEL2
/* /*
* If SPMC is at SEL2, save additional registers x8-x17, which may * If SPMC is at SEL2, save additional registers x8-x17, which may