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

TrustZone MMU Validation

Note: This was originally posted on 19th July 2013 at http://forums.arm.com

I am running code in Secure Mode on a Cortex-A9 platform.  The MMU registers within the CP15 are bank switched when secure mode is entered.  Is it possible to read READ the normal world TTBR0/1 and TTBCR registers.  What is involved in doing this?

Parents
  • Note: This was originally posted on 19th July 2013 at http://forums.arm.com

    Switch into monitor mode
    Disable interrupts,
    Write NS=1 into the CP15 operation to access the normal world copy of the banked registers
    Read values from TTBR/TTBCR into registers
    Set NS=0, re-enable interrupts
    Return out of monitor mode.

    Basically you need NS=1 to access the banked state, and the only place you can do this without changing into the Normal world execution is in monitor mode. The rest of the faffing about with interrupts is just to make this safe.

    HTH,
    Iso
Reply
  • Note: This was originally posted on 19th July 2013 at http://forums.arm.com

    Switch into monitor mode
    Disable interrupts,
    Write NS=1 into the CP15 operation to access the normal world copy of the banked registers
    Read values from TTBR/TTBCR into registers
    Set NS=0, re-enable interrupts
    Return out of monitor mode.

    Basically you need NS=1 to access the banked state, and the only place you can do this without changing into the Normal world execution is in monitor mode. The rest of the faffing about with interrupts is just to make this safe.

    HTH,
    Iso
Children
No data