how virtual page work

The virtual address is partitioned into k VPNs and a VPO. Each VPN i, 1 ≤ i ≤ k, 
is an index into a page table at level i. Each PTE in a level-j table, 1 ≤ j ≤ k − 1,
points to the base of some page table at level j + 1. Each PTE in a level-k table
contains either the PPN of some physical page or the address of a disk block.
To construct the physical address, the MMU must access k PTEs before it can
determine the PPN. As with a single-level hierarchy, the PPO is identical to the
VPO.

36位的vpn被分成4个9位的vpn,没一个小的vpn对应一个map table。9位的vpn可能有2^9=512PTE,而每一个PTE都对应着一个PPN,为了找到VP对应的PPN,MMU可能需要进入k个PT,也就是进入L1、L2、L3、L4PTE。

图解L1PTE 512GB region per entry:因为VP要加载到内存或cache中必须是要先被allocated,有一些VP是还没有被分配的不会加载到内存或cache中,在整一个VP中高level的cache1加载了这个512GB区域的一个地址、因此在L1PT中某一个PTE代表了其他所有还没有被加载的所有512GB地址.所以一个小小的cache就可以映射整个虚拟地址空间。

posted @ 2014-08-25 10:00  been  阅读(118)  评论(0编辑  收藏  举报