diff --git a/services/spd/tspd/tspd_main.c b/services/spd/tspd/tspd_main.c index 2ba9f84..c564f8b 100644 --- a/services/spd/tspd/tspd_main.c +++ b/services/spd/tspd/tspd_main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2017, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2013-2018, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -540,6 +541,18 @@ */ enable_intr_rm_local(INTR_TYPE_NS, SECURE); #endif + +#if EL3_EXCEPTION_HANDLING + /* + * With EL3 exception handling, while an SMC is + * being processed, Non-secure interrupts can't + * preempt Secure execution. However, for + * yielding SMCs, we want preemption to happen; + * so explicitly allow NS preemption in this + * case. + */ + ehf_allow_ns_preemption(); +#endif } cm_el1_sysregs_context_restore(SECURE); @@ -646,7 +659,13 @@ enable_intr_rm_local(INTR_TYPE_NS, SECURE); #endif - +#if EL3_EXCEPTION_HANDLING + /* + * Allow the resumed yielding SMC processing to be preempted by + * Non-secure interrupts. + */ + ehf_allow_ns_preemption(); +#endif /* We just need to return to the preempted point in * TSP and the execution will resume as normal.