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

ARM Context ID Register & Process Context Switch

Hi, all

What is the content of Context ID Register of ARM Cortex A9. Is it OS that is responsible for assigning the value

of Process ID and ASID? As far as I know, it is so in Linux. Is that the same in the other OSes?

Is it essential to deal with ASID if I want to make context switch correctly? Does Cortex A8 have no Context ID

Register? Minix's process context switch running on a Cortex A8 core doesn't cope with ASID when it writes

TTBR.

Thank you.

Best Regards,

Channing M.

Parents
  • Just to expand on Martin's post:

    • For pre-LPAE processors and later processors using "Short-descriptors", the ASID is stored in the least-significant byte of the CONTEXTIDR register. The rest of the register is not used by the MMU.
    • For processors using LPAE's "Long-descriptors", the ASID is stored elsewhere, and the CONTEXTIDR is not used by the MMU.

    ASIDs allow virtual addresses to be tagged to a process, as Martin describes.

    The (portion of the) CONTEXTIDR not used by the MMU is used for debug. E.g. you can tag hardware breakpoints/watchpoints to match on CONTEXTIDR, and ETM trace outputs CONTEXTIDR. The value in the register has no other meaning to the hardware. It is up to the OS to assign a useful value to this for debugging.

Reply
  • Just to expand on Martin's post:

    • For pre-LPAE processors and later processors using "Short-descriptors", the ASID is stored in the least-significant byte of the CONTEXTIDR register. The rest of the register is not used by the MMU.
    • For processors using LPAE's "Long-descriptors", the ASID is stored elsewhere, and the CONTEXTIDR is not used by the MMU.

    ASIDs allow virtual addresses to be tagged to a process, as Martin describes.

    The (portion of the) CONTEXTIDR not used by the MMU is used for debug. E.g. you can tag hardware breakpoints/watchpoints to match on CONTEXTIDR, and ETM trace outputs CONTEXTIDR. The value in the register has no other meaning to the hardware. It is up to the OS to assign a useful value to this for debugging.

Children
No data