Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Arm Trusted Firmware
Commits
7efc390d
Commit
7efc390d
authored
Oct 11, 2017
by
davidcunado-arm
Committed by
GitHub
Oct 11, 2017
Browse files
Merge pull request #1100 from ajs-sun/master
trusty: save/restore FPU registers in world switch
parents
0f49d496
ab609e1a
Changes
1
Hide whitespace changes
Inline
Side-by-side
services/spd/trusty/trusty.c
View file @
7efc390d
...
@@ -99,6 +99,16 @@ static struct args trusty_context_switch(uint32_t security_state, uint64_t r0,
...
@@ -99,6 +99,16 @@ static struct args trusty_context_switch(uint32_t security_state, uint64_t r0,
ret
.
r1
=
r1
;
ret
.
r1
=
r1
;
ret
.
r0
=
r0
;
ret
.
r0
=
r0
;
/*
* To avoid the additional overhead in PSCI flow, skip FP context
* saving/restoring in case of CPU suspend and resume, asssuming that
* when it's needed the PSCI caller has preserved FP context before
* going here.
*/
#if CTX_INCLUDE_FPREGS
if
(
r0
!=
SMC_FC_CPU_SUSPEND
&&
r0
!=
SMC_FC_CPU_RESUME
)
fpregs_context_save
(
get_fpregs_ctx
(
cm_get_context
(
security_state
)));
#endif
cm_el1_sysregs_context_save
(
security_state
);
cm_el1_sysregs_context_save
(
security_state
);
ctx
->
saved_security_state
=
security_state
;
ctx
->
saved_security_state
=
security_state
;
...
@@ -107,6 +117,11 @@ static struct args trusty_context_switch(uint32_t security_state, uint64_t r0,
...
@@ -107,6 +117,11 @@ static struct args trusty_context_switch(uint32_t security_state, uint64_t r0,
assert
(
ctx
->
saved_security_state
==
!
security_state
);
assert
(
ctx
->
saved_security_state
==
!
security_state
);
cm_el1_sysregs_context_restore
(
security_state
);
cm_el1_sysregs_context_restore
(
security_state
);
#if CTX_INCLUDE_FPREGS
if
(
r0
!=
SMC_FC_CPU_SUSPEND
&&
r0
!=
SMC_FC_CPU_RESUME
)
fpregs_context_restore
(
get_fpregs_ctx
(
cm_get_context
(
security_state
)));
#endif
cm_set_next_eret_context
(
security_state
);
cm_set_next_eret_context
(
security_state
);
return
ret
;
return
ret
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment