diff --git a/services/std_svc/spmd/spmd_main.c b/services/std_svc/spmd/spmd_main.c index 5b131cd5e..777a96203 100644 --- a/services/std_svc/spmd/spmd_main.c +++ b/services/std_svc/spmd/spmd_main.c @@ -626,7 +626,8 @@ uint64_t spmd_smc_handler(uint32_t smc_fid, * If caller is secure and SPMC was initialized, * return FFA_VERSION of SPMD. * If caller is non secure and SPMC was initialized, - * return SPMC's version. + * forward to the EL3 SPMC if enabled, otherwise return + * the SPMC version if implemented at a lower EL. * Sanity check to "input_version". * If the EL3 SPMC is enabled, ignore the SPMC state as * this is not used. @@ -635,6 +636,17 @@ uint64_t spmd_smc_handler(uint32_t smc_fid, (!is_spmc_at_el3() && (ctx->state == SPMC_STATE_RESET))) { ret = FFA_ERROR_NOT_SUPPORTED; } else if (!secure_origin) { + if (is_spmc_at_el3()) { + /* + * Forward the call directly to the EL3 SPMC, if + * enabled, as we don't need to wrap the call in + * a direct request. + */ + return spmd_smc_forward(smc_fid, secure_origin, + x1, x2, x3, x4, cookie, + handle, flags); + } + gp_regs_t *gpregs = get_gpregs_ctx(&ctx->cpu_ctx); uint64_t rc;