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.

StartEndUse
ffff8000ffffffffcopy_user_page / clear_user_page use.For SA11xx and Xscale, this is used tosetup a minicache mapping.
ffff4000ffffffffcache aliasing on ARMv6 and later CPUs.
ffff1000ffff7fffReserved.Platforms must not use this address range.
ffff0000ffff0fffCPU vector page.The CPU vectors are mapped here if theCPU supports vector relocation (controlregister V bit.)
fffe0000fffeffffXScale cache flush area. This is usedin proc-xscale.S to flush the whole datacache. (XScale does not have TCM.)
fffe8000fffeffffDTCM mapping area for platforms withDTCM mounted inside the CPU.
fffe0000fffe7fffITCM mapping area for platforms withITCM mounted inside the CPU.
ffc00000ffefffffFixmap mapping region. Addresses providedby fix_to_virt() will be located here.
fee00000feffffffMapping of PCI I/O space. This is a staticmapping within the vmalloc space.
VMALLOC_STARTVMALLOC_END-1vmalloc() /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_OFFSEThigh_memory-1Kernel direct-mapped RAM region.This maps the platforms RAM, and typicallymaps all platform RAM in a 1:1 relationship.
PKMAP_BASEPAGE_OFFSET-1Permanent kernel mappingsOne way of mapping HIGHMEM pages into kernelspace.
MODULES_VADDRMODULES_END-1Kernel module spaceKernel modules inserted via insmod areplaced here using dynamic mappings.
00001000TASK_SIZE-1User space mappingsPer-thread mappings are placed here viathe mmap() system call.
0000000000000fffCPU 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().