memory.txt
2013/11/04
Kernel Memory Layout on ARM Linux
Russell King
November 17, 2005 (2.6.15)
This document describes the virtual memory layout which the Linux kernel uses for ARM processors.このドキュメントでは、LinuxカーネルがARMプロセッサ用に使用する仮想メモリのレイアウトを記述します。
It indicates which regions are free for platforms to use, and which are used by generic code.
これは、プラットフォームが使用するためのフリーな領域がどこにあるか、そして、汎用コードによって使用されるのはどこか、を示します。
The ARM CPU is capable of addressing a maximum of 4GB virtual memory space,ARM CPUは、最大4GBの仮想メモリ空間アドレッシングを許容します。
and this must be shared between user space processes, the kernel, and hardware devices.
この空間は、ユーザ空間プロセス、カーネル、ハードウェアデバイスの間で共有する必要があります。
As the ARM architecture matures, it becomes necessary to reserve certain regions of VM space for use for new facilities;ARMアーキテクチャは静寂するにつれて、新しい設備(機能)を使うために、仮想空間の特定の領域を予約する必要が出てきます。
therefore this document may reserve more VM space over time.
したがって、このドキュメントは、時間の経過と共に、より多くの仮想空間を仮想空間を予約するでしょう。
Start | End | Use |
---|---|---|
ffff8000 | ffffffff | copy_user_page / clear_user_page で使う。 SA11xx と Xscale では、minicache mappingの設定に使う。 |
ffff4000 | ffffffff | ARMv6アーキ以降の cache aliasing |
ffff1000 | ffff7fff | Reserved. Platformsはこの領域を使ってはいけない |
ffff0000 | ffff0fff | CPU vector page. CPUがヴェクタリロケーションをサポートしていれば、ここにマップされる(Control RegisterのV bitで設定) |
fffe0000 | fffeffff | XScale cache flush area. This is used in proc-xscale.S to flush the whole data cache. (XScale does not have TCM.) |
fffe8000 | fffeffff | DTCM mapping area. for platforms with DTCM mounted inside the CPU. |
fffe0000 | fffe7fff | ITCM mapping area for platforms with ITCM mounted inside the CPU. |
fff00000 | fffdffff | Fixmap mapping region. fix_to_virt()で与えられるアドレスは、ここに配置される。 |
ffc00000 | ffefffff | DMA memory mapping region. the dma_alloc_xxx()で返ってくるメモリが、ここに動的にマップされる。 |
ff000000 | ffbfffff | Reserved for future expansion of DMA mapping region. |
fee00000 | feffffff | Mapping of PCI I/O space. これは、vmalloc空間の静的マッピングです。 |
VMALLOC_START | VMALLOC_END-1 | vmalloc() / ioremap() 空間。 vmalloc(),ioremap()によって返されるメモリは、この領域に動的に配置される。 マシン固有の静的マッピングも、iotable_init()によって、ここに配置される。 VMALLOC_STARTは、high_memory変数の値に基づいて得られる。VMALLOC_ENDは0xff000000である(ヘッダで定義)。 |
PAGE_OFFSET | high_memory-1 | Kernel direct-mapped RAM region. これは、プラットフォームのRAM、通常は、1:1の関係にあるすべてのプラットフォームのRAMを配置します。 CONFIG_PAGE_OFFSETで設定する。一般的な32bit kernelでは 0xC0000000(kernel:user=1GB:3GB設定)となっている。 |
PKMAP_BASE | PAGE_OFFSET-1 | 永続的なkernelマッピング。 カーネル空間にHIGHMEMページを配置する方法の一つ。 |
MODULES_VADDR | MODULES_END-1 | Kernel module space. insmodにより挿入されるKernel modulesは、ここに動的に配置されます。 |
00001000 | TASK_SIZE-1 | User space mappings. スレッド毎のマッピングは、mmap()システムコールにより、ここに配置される。 |
00000000 | 00000fff | CPU vector page / null pointer trap. ヴェクタremapをサポートしていないCPUは、ヴェクタページをここに配置します。 kernel空間・user空間の双方から、NULLポインタデリファレンスもまた、この配置から捕まえられます。 |
Please note that mappings which collide with the above areas may result in a non-bootable kernel,上記領域と衝突するマッピングは、非ブートカーネルになったり、実行時に(最終的に)kernel panic要因となるかもしれないことに、ご注意ください。
or may cause the kernel to (eventually) panic at run time.
Since future CPUs may impact the kernel mapping layout,将来のCPUでは、kernelマッピングレイアウトに影響があるかもしれないので、ユーザプログラムは、0x0001000からTASK_SIZEまでのアドレス範囲から外れたメモリをアクセスしてはならない。
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().
もしそれらの領域をアクセスしたければ、open()やmmap()を使って、固有のマッピングをセットアップしなければならない。
関連ファイル
FILE: arch/arm/include/asm/fixmap.hめも
更新されていないのか、vendorの仕様か、ちょっと配置が違う気がする。変数を書き換えれば、上の方(vmalloc前後)は任意に動くから、いじってるかもなぁ。