The first step is to create a page . This table is actually one of a pair. The technical term is“kernel page table isolation.”. Every operating system has its own way of storing page table .
Each process has its own set of page tables , but there is a catch. This made the page tables available to user mode code in every process. 每一个进程拥有一套属于它自己的页表 ,但是还有一个隐情。 Each process has its own set of page tables , but there is a catch. 它只需要4个物理帧,但是页表 中有超过100万个项目。 It only needs 4 physical frames, but the page table has over a million entries. KPTI通过完全分离用户空间与内核空间页表来解决页表 泄露。 KPTI fixes these leaks by separating user-space and kernel-space page tables entirely. 下一步就是顺着第0或者1个页表项的指针追踪到第3级页表 。 The next step would be to follow the pointers in entry 0 or entry 1 to a level 3 page table . 采用倒置页表 的系统包括64位UltraSPARC和PowerPC。 Examples of systems using inverted page tables include the 64-bit UltraSPARC and PowerPC. 分页使用一个名为页表 (pagetable)的结构来存储它的映射信息。 Instead paging uses a table structure called page table to store the mapping information. 如上所述,对于使用大型SGA的系统,页表 结构可能会变得非常大。 As mentioned earlier, for systems using large SGAs, the Page Tables structure can get very large. 此方法提供一个兼容性的优势,因为它保留了4个字节的PTE(页表 条目)大小。 This method offers a compatibility advantage because it kept the PTE(page table entry) size of 4 bytes. 清单1中的Linux系统输出示例显示页表 条目占用了766MB的RAM。 The sample Linux system output in Listing 1 shows the Page Tables entries taking up 766 MB of RAM. 这将减小页表 结构的大小,提高TLB命中率,并降低kswapd使用率。 This will reduce the size of the Page Tables structure, improve the TLB cache hit ratio, and reduce kswapd usage. 逻辑地址4的页码为1,页偏移为0,根据页表 ,页码1对应为帧6。 Logical address 4 is page 1, offset 0; according to the page table , page 1 is mapped to frame 6. 如repr属性所示,页表 需要跟页面对齐,即在4KiB的边界上对齐。 As indicated by the repr attribute, page tables need to be page aligned, i.e. aligned on a 4KiB boundary. 有一个从虚拟地址到物理地址的映射,并存储在一个称为页表 的大型数据结构中。 There's a mapping from virtual addresses to physical addresses, and that's stored in a large data structure called a page table . 如果系统的页大小为4KB(212),那么页表 可以多达100万的条目(232/212)。 If the page size in such a system is 4 KB(212), then a page table may consist of up to 1 million entries(232/212). 如果这个位设为1,则页目录的表项不再指向页表 ,而是指向一个2MiB的页。 If this bit is set to 1, the page directory entry does not point to a page table , but to a single large 2 MB page. . 此外,即使在硬件中存有缓存,比如页表 的单独缓存,这种问题也可能在软件中出现。 Moreover, even if mitigations are possible in hardware, such as separate cache for page tables , the problems may well resurface in software. 从数学角度说,页表 是一个函数,它的参数是虚拟页号,结果是物理页框号。 Mathematically speaking, the page table is a function, with the virtual page number as argument and the physical frame number as result. 从页表 索引我们可以推断出这两个页面的虚拟地址是0x803FE7F000和0x803FE00000。 From the page table indices we can deduce that the virtual addresses of these two pages are 0x803FE7F000 and 0x803FE00000. 这是因为我们不需要为10_000和1_000_000之间未映射的内存区域创建1级页表 。 The reason for this savings is that we don't need to create level 1 page tables for the unmapped memory regions between 10_000 and 1_000_000. 为防范Meltdown--这个影响Intel芯片的问题,在x86架构上开发者实现了页表 隔离(PTI)。 To avoid Meltdown, a problem that affects Intel chips, developers have implemented Page Table Isolation(PTI) for the x86 architecture. PSE使用一个标准的1K目录和没有页表 扩展大小4MB页(消除一个级别的间接寻址该模式)。 PSE uses a standard 1K directory and no page tables to extend the page size 4-MB(eliminating one level of indirection for that mode). 聚簇页表 对于稀疏地址空间特别有用,这里的引用是不连续的并且散布在整个地址空间中。 Clustered page tables are particularly useful for sparse address spaces, where memory references are noncontiguous and scattered throughout the address space.
Display more examples
Results: 29 ,
Time: 0.0143