This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Is preemption possible after state change to non-secure using BLXNS?

In ARMv8-M, there is BLXNS instruction to call a non-secure procedure from secure world, and the architectural reference manual mentions that it makes IPSR to 1.

Then, does it mean that the priority becomes -4 as the exception number (IPSR) is the same as that of Reset?

In other words, does it mean that no preemption due to interrupt is possible after BLXNS to the non-secure world until returning back to the secure world?

If that's true, are there any method to make preemption possible, for example by lowering the priority of Reset Exception just like how setting PRIMASK_NS and AIRCR.PRIS flags turn PRIMASK boosting priority from 0 to 0x80?

Thanks for any help!

  • Hi dnjsdnwja,

    On execution of BLXNS instruction to perform a security state transition from secure state to non-secure state, only the exception number on a BLXNS gets changed in the IPSR, not the priority of target end address. 

    A function call which does state transition between secure to non-secure state does not have a priority number associated with it. Exception number and priority number are two separate properties. These two properties plays an active role when there is an "exception" associated with it and not on a "function call".

    Hence preemption through Non-secure interrupts/exceptions is possible in Non-secure state ( post switching to Non-secure state on a successful execution of BLXNS instruction along with additional steps to make the transition safe).

    Thanks,

    Uma