ARMv8-A Address translation
ARMv8-A uses a Virtual Memory system where the addresses used by code (virtual addresses) are translated into physical addresses which are used by the memory system. This translation is performed by a part of the processor that is called a Memory Management Unit (MMU). MMUs in the ARM architecture use translation tables stored in memory to translate virtual addresses to physical addresses. The MMU will automatically read the translation tables when necessary, this process is known as a Table Walk.
An important function of the MMU is to enable the system to run multiple tasks, as independent programs running in their own private virtual memory space. They do not need any knowledge of the physical memory map of the system, that is, the addresses that are used by the hardware, or about other programs that might execute at the same time.
You can use the same virtual memory address space for each program. You can also work with a contiguous virtual memory map, even if the physical memory is fragmented. This virtual address space is separate from the actual physical map of memory in the system. You can write, compile, and link applications to run in the virtual memory space. Different processors and devices in a single system might have different virtual and physical address maps. Privileged software, such as an Operating System, programs the MMU to translate between these two views of memory as the following figure shows.
To do this, the hardware in a virtual memory system must provide address translation, which is the translation of the virtual address that is issued by the processor to a physical address in the main memory.
Virtual addresses are those used by you, and the compiler and linker, when placing code in memory. Physical addresses are those used by the actual hardware system.
The MMU uses the most significant bits of the virtual address to index entries in a translation table and establish which block is being accessed. The MMU translates the virtual addresses of code and data to the physical addresses in the actual system. The translation is carried out automatically in hardware and is transparent to the application. In addition to address translation, the MMU controls memory access permissions, memory ordering, and cache policies for each region of memory.
Address translation using translation tables is shown in the following figure:
The MMU enables tasks or applications to be written in a way that requires them to have no knowledge of the physical memory map of the system, or about other programs that might be running simultaneously. This enables the same virtual memory address space to be used for each program. It also works with a contiguous virtual memory map, even if the physical memory is fragmented. This virtual address space is separate from the actual physical map of memory in the system. Applications are written, compiled, and linked to run in the virtual memory space.