From mboxrd@z Thu Jan 1 00:00:00 1970 From: arshad.super@gmail.com (arshad hussain) Date: Wed, 13 Dec 2017 10:05:57 +0530 Subject: Virtual Memory map In-Reply-To: <20171212191435.GB1921@zrhn9910b> References: <20171212191435.GB1921@zrhn9910b> Message-ID: To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org On Wed, Dec 13, 2017 at 12:44 AM, Damian Tometzki wrote: > Hello all, > > i have a short question: > > How are the bits (in brackets) calculated in the virtual memory map ? > > for example the first line (=47 bits) > > Virtual memory map with 4 level page tables: > > 0000000000000000 - 00007fffffffffff (=47 bits) user space, different per mm > hole caused by [47:63] sign extension > ffff800000000000 - ffff87ffffffffff (=43 bits) guard hole, reserved for hypervisor > Presently for x86-64 kernel uses 4-level paging. Out of 64bit only 48 bit is enabled (Which boils down to Terabyte of address space). For case where getpagesize() is 4K the breakup is :- CR3 -> Global(9 bits) -> Upper(9 bits) -> Middle(9 bits) -> Page table(9 bits) -> [12 bits for page or 4096 bytes] = (48 bits) Thanks