@ -1,5 +1,5 @@
/*
/*
* Copyright ( c ) 2017 - 2022 , ARM Limited and Contributors . All rights reserved .
* Copyright ( c ) 2017 - 2024 , Arm Limited and Contributors . All rights reserved .
*
*
* SPDX - License - Identifier : BSD - 3 - Clause
* SPDX - License - Identifier : BSD - 3 - Clause
*/
*/
@ -13,6 +13,7 @@
# include <common/debug.h>
# include <common/debug.h>
# include <common/runtime_svc.h>
# include <common/runtime_svc.h>
# include <lib/el3_runtime/context_mgmt.h>
# include <lib/el3_runtime/context_mgmt.h>
# include <lib/el3_runtime/simd_ctx.h>
# include <lib/smccc.h>
# include <lib/smccc.h>
# include <lib/spinlock.h>
# include <lib/spinlock.h>
# include <lib/utils.h>
# include <lib/utils.h>
@ -190,13 +191,13 @@ uint64_t spm_mm_sp_call(uint32_t smc_fid, uint64_t x1, uint64_t x2, uint64_t x3)
uint64_t rc ;
uint64_t rc ;
sp_context_t * sp_ptr = & sp_ctx ;
sp_context_t * sp_ptr = & sp_ctx ;
# if CTX_INCLUDE_FPREGS
# if CTX_INCLUDE_FPREGS || CTX_INCLUDE_SVE_REGS
/*
/*
* SP runs to completion , no need to restore FP registers of secure context .
* SP runs to completion , no need to restore FP / SVE registers of secure context .
* Save FP registers only for non secure context .
* Save FP / SVE registers only for non secure context .
*/
*/
fpreg s_con te xt _save( get_fpregs_ctx ( cm_get_context ( NON_SECURE ) ) ) ;
simd _ctx_save ( NON_SECURE , false ) ;
# endif
# endif /* CTX_INCLUDE_FPREGS || CTX_INCLUDE_SVE_REGS */
/* Wait until the Secure Partition is idle and set it to busy. */
/* Wait until the Secure Partition is idle and set it to busy. */
sp_state_wait_switch ( sp_ptr , SP_STATE_IDLE , SP_STATE_BUSY ) ;
sp_state_wait_switch ( sp_ptr , SP_STATE_IDLE , SP_STATE_BUSY ) ;
@ -216,13 +217,13 @@ uint64_t spm_mm_sp_call(uint32_t smc_fid, uint64_t x1, uint64_t x2, uint64_t x3)
assert ( sp_ptr - > state = = SP_STATE_BUSY ) ;
assert ( sp_ptr - > state = = SP_STATE_BUSY ) ;
sp_state_set ( sp_ptr , SP_STATE_IDLE ) ;
sp_state_set ( sp_ptr , SP_STATE_IDLE ) ;
# if CTX_INCLUDE_FPREGS
# if CTX_INCLUDE_FPREGS || CTX_INCLUDE_SVE_REGS
/*
/*
* SP runs to completion , no need to save FP registers of secure context .
* SP runs to completion , no need to save FP / SVE registers of secure context .
* Restore only non secure world FP registers .
* Restore only non secure world FP / SVE registers .
*/
*/
fpreg s_con te xt _restore( get_fpregs_ctx ( cm_get_context ( NON_SECURE ) ) ) ;
simd _ctx_restore ( NON_SECURE ) ;
# endif
# endif /* CTX_INCLUDE_FPREGS || CTX_INCLUDE_SVE_REGS */
return rc ;
return rc ;
}
}