Merge changes from topic "ns/save_fpregs_context" into integration
* changes: feat(sgi): enable fpregs context save and restore feat(spm_mm): add support to save and restore fp regs
This commit is contained in:
commit
0dc2b51681
|
@ -23,6 +23,8 @@ CSS_SGI_PLATFORM_VARIANT := 0
|
||||||
# Do not enable SVE
|
# Do not enable SVE
|
||||||
ENABLE_SVE_FOR_NS := 0
|
ENABLE_SVE_FOR_NS := 0
|
||||||
|
|
||||||
|
CTX_INCLUDE_FPREGS := 1
|
||||||
|
|
||||||
INTERCONNECT_SOURCES := ${CSS_ENT_BASE}/sgi_interconnect.c
|
INTERCONNECT_SOURCES := ${CSS_ENT_BASE}/sgi_interconnect.c
|
||||||
|
|
||||||
PLAT_INCLUDES += -I${CSS_ENT_BASE}/include
|
PLAT_INCLUDES += -I${CSS_ENT_BASE}/include
|
||||||
|
|
|
@ -16,6 +16,9 @@ endif
|
||||||
ifeq (${ENABLE_SME_FOR_NS},1)
|
ifeq (${ENABLE_SME_FOR_NS},1)
|
||||||
$(error "Error: SPM_MM is not compatible with ENABLE_SME_FOR_NS")
|
$(error "Error: SPM_MM is not compatible with ENABLE_SME_FOR_NS")
|
||||||
endif
|
endif
|
||||||
|
ifeq (${CTX_INCLUDE_FPREGS},0)
|
||||||
|
$(warning "Warning: SPM_MM: CTX_INCLUDE_FPREGS is set to 0")
|
||||||
|
endif
|
||||||
|
|
||||||
SPM_MM_SOURCES := $(addprefix services/std_svc/spm/spm_mm/, \
|
SPM_MM_SOURCES := $(addprefix services/std_svc/spm/spm_mm/, \
|
||||||
${ARCH}/spm_mm_shim_exceptions.S \
|
${ARCH}/spm_mm_shim_exceptions.S \
|
||||||
|
|
|
@ -190,6 +190,14 @@ 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
|
||||||
|
/*
|
||||||
|
* SP runs to completion, no need to restore FP registers of secure context.
|
||||||
|
* Save FP registers only for non secure context.
|
||||||
|
*/
|
||||||
|
fpregs_context_save(get_fpregs_ctx(cm_get_context(NON_SECURE)));
|
||||||
|
#endif
|
||||||
|
|
||||||
/* 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);
|
||||||
|
|
||||||
|
@ -208,6 +216,14 @@ 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
|
||||||
|
/*
|
||||||
|
* SP runs to completion, no need to save FP registers of secure context.
|
||||||
|
* Restore only non secure world FP registers.
|
||||||
|
*/
|
||||||
|
fpregs_context_restore(get_fpregs_ctx(cm_get_context(NON_SECURE)));
|
||||||
|
#endif
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue