summaryrefslogtreecommitdiff
path: root/services
diff options
context:
space:
mode:
authordanh-arm <dan.handley@arm.com>2017-02-28 12:06:54 +0000
committerGitHub <noreply@github.com>2017-02-28 12:06:54 +0000
commit5e810a85b1a29a074252564584d836012b1ac486 (patch)
tree7a39035af6be873915d2b89502a96fccddc040c7 /services
parent7befa5a9326f8861da1536f78ea917f882fd8f1b (diff)
parent57a5a56c111cb988e0ee54b57a6b47e5f483dd94 (diff)
Merge pull request #847 from douglas-raillard-arm/dr/fix_abort_smc
Fix TSPD implementation of STD SMC ABORT
Diffstat (limited to 'services')
-rw-r--r--services/spd/tspd/tspd_main.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/services/spd/tspd/tspd_main.c b/services/spd/tspd/tspd_main.c
index 2850e703..ff515cca 100644
--- a/services/spd/tspd/tspd_main.c
+++ b/services/spd/tspd/tspd_main.c
@@ -612,15 +612,26 @@ uint64_t tspd_smc_handler(uint32_t smc_fid,
break;
}
+ assert(handle == cm_get_context(NON_SECURE));
+ cm_el1_sysregs_context_save(NON_SECURE);
+
/* Abort the preempted SMC request */
- if (!tspd_abort_preempted_smc(tsp_ctx))
+ if (!tspd_abort_preempted_smc(tsp_ctx)) {
/*
* If there was no preempted SMC to abort, return
* SMC_UNK.
+ *
+ * Restoring the NON_SECURE context is not necessary as
+ * the synchronous entry did not take place if the
+ * return code of tspd_abort_preempted_smc is zero.
*/
- SMC_RET1(handle, SMC_UNK);
+ cm_set_next_eret_context(NON_SECURE);
+ break;
+ }
- break;
+ cm_el1_sysregs_context_restore(NON_SECURE);
+ cm_set_next_eret_context(NON_SECURE);
+ SMC_RET0(handle);
/*
* Request from non secure world to resume the preempted