Linux記憶體管理 - PAGE_OFFSET理解

來源:互聯網
上載者:User

標籤:page_offset


Linux記憶體管理 - PAGE_OFFSET理解
     PAGE_OFFSET 代表的是核心空間和使用者空間對虛擬位址空間的劃分,對不同的體繫結構不同。比如在32位系統中3G-4G 屬於核心使用的記憶體空間,所以 PAGE_OFFSET = 0xC0000000。在X86-64架構下是ffff880000000000。可以看到核心程式可以可以訪問從PAGE_OFFSET 之後的記憶體,訪問所有的資訊(注意頁的防寫保護)。

參考:https://www.kernel.org/doc/Documentation/x86/x86_64/mm.txt
Virtual memory map with 4 level page tables:0000000000000000 - 00007fffffffffff (=47 bits) user space, different per mmhole caused by [48:63] sign extensionffff800000000000 - ffff87ffffffffff (=43 bits) guard hole, reserved for hypervisorffff880000000000 - ffffc7ffffffffff (=64 TB) direct mapping of all phys. memoryffffc80000000000 - ffffc8ffffffffff (=40 bits) holeffffc90000000000 - ffffe8ffffffffff (=45 bits) vmalloc/ioremap spaceffffe90000000000 - ffffe9ffffffffff (=40 bits) holeffffea0000000000 - ffffeaffffffffff (=40 bits) virtual memory map (1TB)... unused hole ...ffffff0000000000 - ffffff7fffffffff (=39 bits) %esp fixup stacks... unused hole ...ffffffff80000000 - ffffffffa0000000 (=512 MB)  kernel text mapping, from phys 0ffffffffa0000000 - ffffffffff5fffff (=1525 MB) module mapping spaceffffffffff600000 - ffffffffffdfffff (=8 MB) vsyscallsffffffffffe00000 - ffffffffffffffff (=2 MB) unused holeThe direct mapping covers all memory in the system up to the highestmemory address (this means in some cases it can also include PCI memoryholes).vmalloc space is lazily synchronized into the different PML4 pages ofthe processes using the page fault handler, with init_level4_pgt asreference.Current X86-64 implementations only support 40 bits of address space,but we support up to 46 bits. This expands into MBZ space in the page tables.->trampoline_pgd:We map EFI runtime services in the aforementioned PGD in the virtualrange of 64Gb (arbitrarily set, can be raised if needed)0xffffffef00000000 - 0xffffffff00000000-Andi Kleen, Jul 2004

Linux記憶體管理 - PAGE_OFFSET理解

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.