Kernel Memory Layout on ARM Linux¶
Russell King <rmk@arm.linux.org.uk>
November 17, 2005 (2.6.15)
This document describes the virtual memory layout which the Linuxkernel uses for ARM processors. It indicates which regions arefree for platforms to use, and which are used by generic code.
The ARM CPU is capable of addressing a maximum of 4GB virtual memoryspace, and this must be shared between user space processes, thekernel, and hardware devices.
As the ARM architecture matures, it becomes necessary to reservecertain regions of VM space for use for new facilities; thereforethis document may reserve more VM space over time.
| Start | End | Use |
|---|---|---|
| ffff8000 | ffffffff | copy_user_page / clear_user_page use.For SA11xx and Xscale, this is used tosetup a minicache mapping. |
| ffff4000 | ffffffff | cache aliasing on ARMv6 and later CPUs. |
| ffff1000 | ffff7fff | Reserved.Platforms must not use this address range. |
| ffff0000 | ffff0fff | CPU vector page.The CPU vectors are mapped here if theCPU supports vector relocation (controlregister V bit.) |
| fffe0000 | fffeffff | XScale cache flush area. This is usedin proc-xscale.S to flush the whole datacache. (XScale does not have TCM.) |
| fffe8000 | fffeffff | DTCM mapping area for platforms withDTCM mounted inside the CPU. |
| fffe0000 | fffe7fff | ITCM mapping area for platforms withITCM mounted inside the CPU. |
| ffc00000 | ffefffff | Fixmap mapping region. Addresses providedby fix_to_virt() will be located here. |
| fee00000 | feffffff | Mapping of PCI I/O space. This is a staticmapping within the vmalloc space. |
| VMALLOC_START | VMALLOC_END-1 | vmalloc() /ioremap() space.Memory returned by vmalloc/ioremap willbe dynamically placed in this region.Machine specific static mappings are alsolocated here through iotable_init().VMALLOC_START is based upon the valueof the high_memory variable, and VMALLOC_ENDis equal to 0xff800000. |
| PAGE_OFFSET | high_memory-1 | Kernel direct-mapped RAM region.This maps the platforms RAM, and typicallymaps all platform RAM in a 1:1 relationship. |
| PKMAP_BASE | PAGE_OFFSET-1 | Permanent kernel mappingsOne way of mapping HIGHMEM pages into kernelspace. |
| MODULES_VADDR | MODULES_END-1 | Kernel module spaceKernel modules inserted via insmod areplaced here using dynamic mappings. |
| 00001000 | TASK_SIZE-1 | User space mappingsPer-thread mappings are placed here viathe mmap() system call. |
| 00000000 | 00000fff | CPU vector page / null pointer trapCPUs which do not support vector remappingplace their vector page here. NULL pointerdereferences by both the kernel and userspace are also caught via this mapping. |
Please note that mappings which collide with the above areas may resultin a non-bootable kernel, or may cause the kernel to (eventually) panicat run time.
Since future CPUs may impact the kernel mapping layout, user programsmust not access any memory which is not mapped inside their 0x0001000to TASK_SIZE address range. If they wish to access these areas, theymust set up their own mappings using open() and mmap().