feat(spmd): enable SPMD to forward FFA_VERSION to EL3 SPMC
In order to allow the EL3 SPMC to know the FF-A version of the entity running in the normal world, allow the SPMD to forward the call rather than replying on its behalf. This solution works as the EL3 can ERET directly back to the calling partition however this is not an option when the SPMC resides in a lower exception level. A new approach will be required to support such scenario. Signed-off-by: Marc Bonnici <marc.bonnici@arm.com> Change-Id: Ic2d6e49c06340167eadefe893c6e1e20b67ab498
This commit is contained in:
parent
0c7707fdf2
commit
9576fa93a2
|
@ -626,7 +626,8 @@ uint64_t spmd_smc_handler(uint32_t smc_fid,
|
||||||
* If caller is secure and SPMC was initialized,
|
* If caller is secure and SPMC was initialized,
|
||||||
* return FFA_VERSION of SPMD.
|
* return FFA_VERSION of SPMD.
|
||||||
* If caller is non secure and SPMC was initialized,
|
* 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".
|
* Sanity check to "input_version".
|
||||||
* If the EL3 SPMC is enabled, ignore the SPMC state as
|
* If the EL3 SPMC is enabled, ignore the SPMC state as
|
||||||
* this is not used.
|
* 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))) {
|
(!is_spmc_at_el3() && (ctx->state == SPMC_STATE_RESET))) {
|
||||||
ret = FFA_ERROR_NOT_SUPPORTED;
|
ret = FFA_ERROR_NOT_SUPPORTED;
|
||||||
} else if (!secure_origin) {
|
} 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);
|
gp_regs_t *gpregs = get_gpregs_ctx(&ctx->cpu_ctx);
|
||||||
uint64_t rc;
|
uint64_t rc;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue