Kernel Memory Layout on ARM Linux
Russell King <rmk@arm.linux.org.uk>
November 17, 2005 (2.6.15)
这篇文档描述了基于arm处理器的linux内核中的虚拟内存布局。该文档简要说明了内存中的哪些部分可以供平台使用,哪些部分可以被代码编程使用。
This document describes the virtual memory layout which the Linux
kernel uses for ARM processors. It indicates which regions are
free for platforms to use, and which are used by generic code.
arm处理器最大寻址可达到4GB的虚拟内存空间。用户空间的进程、linux内核和硬件设备共同使用这虚拟的内存空间。
The ARM CPU is capable of addressing a maximum of 4GB virtual memory
space, and this must be shared between user space processes, the
kernel, and hardware devices.
随着arm架构地发展成熟,有必要保留用于新设备的虚拟空间中的某些区域;因此,随着时间的推移,这篇文档可能会保留更多的虚拟空间。
As the ARM architecture matures, it becomes necessary to reserve
certain regions of VM space for use for new facilities; therefore
this document may reserve more VM space over time.
Start End Use
Start | End | Use | Translation |
---|---|---|---|
ffff8000 | ffffffff | copy_user_page / clear_user_page use. For SA11xx and Xscale, this is used to setup a minicache mapping. | 复制用户页面/清除用户页面使用。对于SA11xx和XScale,这用于设置小型缓存映射。 |
ffff4000 | ffffffff | cache aliasing on ARMv6 and later CPUs. | 在ARMV6和更高版本的CPU上缓存的别名。 |
ffff1000 | ffff7fff | Reserved. Platforms must not use this address range. | 保留的。平台不能使用此地址范围。 |
ffff0000 | ffff0fff | CPU vector page.The CPU vectors are mapped here if the CPU supports vector relocation (control register V bit.) | CPU向量页。如果CPU支持向量重定位,那么CPU向量将会映射到这个区域(控制寄存器 V 位) |
fffe0000 | fffeffff | XScale cache flush area. This is used in proc-xscale.S to flush the whole data cache. (XScale does not have TCM.) | XScale缓存刷新区域。这在proc-xscale.s中用于刷新整个数据缓存。(XScale没有TCM。) |
fffe8000 | fffeffff | DTCM mapping area for platforms with DTCM mounted inside the CPU. | DTCM映射区域,用于安装在CPU内的DTCM平台。 |
fffe0000 | fffe7fff | ITCM mapping area for platforms with ITCM mounted inside the CPU. | ITCM映射区域,用于安装在CPU内的ITCM平台。 |
fff00000 | fffdffff | Fixmap mapping region. Addresses provided by fix_to_virt() will be located here. | Fixmap映射区域。fix_to_virt()提供的地址将位于此处 |
ffc00000 | ffefffff | DMA memory mapping region. Memory returned by the dma_alloc_xxx functions will be dynamically mapped here. | DMA内存映射区域。dma_alloc_xxx函数返回的内存将在此处动态映射。 |
ff000000 | ffbfffff | Reserved for future expansion of DMA mapping region. | 为将来的DMA映射区域扩展预留 |
VMALLOC_START | VMALLOC_END-1 | vmalloc() / ioremap() space. Memory returned by vmalloc/ioremap will be dynamically placed in this region. Machine specific static mappings are also located here through iotable_init(). VMALLOC_START is based upon the value of the high_memory variable, and VMALLOC_END is equal to 0xff000000. | vmalloc() / ioremap()空间。通过vmalloc() / ioremap()映射的内存会被动态地放置在这一地区。通过使用iotable _ init()这种指定的静态映射的区域也是被定位到这个区域。VMALLOC_START的值是基于高端内存量,VMALLOC_END等于0xff000000。 |
PAGE_OFFSET | high_memory-1 | Kernel direct-mapped RAM region. This maps the platforms RAM, and typically maps all platform RAM in a 1:1 relationship. | 内核直接映射RAM区域。这将映射平台RAM,并且通常以1:1关系映射所有平台RAM。 |
PKMAP_BASE | PAGE_OFFSET-1 | Permanent kernel mappings One way of mapping HIGHMEM pages into kernel space. | 永久内核映射是一种将highmem页映射到内核空间的方法 |
MODULES_VADDR | MODULES_END-1 | Kernel module space Kernel modules inserted via insmod are placed here using dynamic mappings. | 通过insmod插入的内核模块所在的空间使用动态映射放置在此处 |
00001000 | TASK_SIZE-1 | User space mappings Per-thread mappings are placed here via the mmap() system call. | 每个线程的用户空间映射通过mmap()系统调用放置在这里 |
00000000 | 00000fff | CPU vector page / null pointer trap CPUs which do not support vector remapping place their vector page here. NULL pointer dereferences by both the kernel and user space are also caught via this mapping. | CPU向量页/空指针陷阱不支持向量重新映射的CPU将其向量页放在此处。内核和用户空间对空指针的取消引用也通过此映射捕获。 |
请注意,如果映射的逻辑地址与上述区域有冲突的话,内核可能无法被引导启动,或者内核在运行过程中报panic错误。
Please note that mappings which collide with the above areas may result
in a non-bootable kernel, or may cause the kernel to (eventually) panic
at run time.
随着以后的CPU可能会影响内核的映射布局的趋势,用户程序一定不能访问任何不在0x0001000到TASK_SIZE的地址范围内的映射内存。如果想要访问这些区域,就必须通过使用open和mmap来设置自己的映射区域。
Since future CPUs may impact the kernel mapping layout, user programs
must not access any memory which is not mapped inside their 0x0001000
to TASK_SIZE address range. If they wish to access these areas, they
must set up their own mappings using open() and mmap().