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

How to get the secure(or non-secure) state on Cortex-A53?

Could anyone give me the code to get the current secure state?

Parents
  • There isn't really a simple way to do this.  You could infer it by accessing one of the Secure only System registers.  If the access succeeds you are in Secure state, if it Undefs then you aren't(*).

    One explanation for which there isn't an easy way to do this is that software generally already knows.  This is Hypervisor code, therefore currently in Non-secure state at EL2.  This is Secure Firmware code, therefore currently in EL3.

    (* It's actually a little more tricky than that, as the access could also fail due to insufficient privilege).

Reply
  • There isn't really a simple way to do this.  You could infer it by accessing one of the Secure only System registers.  If the access succeeds you are in Secure state, if it Undefs then you aren't(*).

    One explanation for which there isn't an easy way to do this is that software generally already knows.  This is Hypervisor code, therefore currently in Non-secure state at EL2.  This is Secure Firmware code, therefore currently in EL3.

    (* It's actually a little more tricky than that, as the access could also fail due to insufficient privilege).

Children