title: Will physical addresses of all paging structures in Linux be mapped in the page tables
body: <p>In 64-bit Linux, <code>IA-32E paging</code> is used with 4 levels of paging structures (<code>PML4</code>/<code>PDPT</code>/<code>PD</code>/<code>PT</code>). The entries in the former three structures give the physical address of the corresponding next structure. My <strong>question</strong> is that will the physical addresses of all these paging structures be mapped in the paging table? If they are mapped, in which mode (<code>User</code>/<code>Supervisor</code>)? Thanks very much!  </p>
  
  <p>I captured some specific memory addresses which a <code>vcpu</code> have accessed during a period in <code>KVM</code>. These addresses are in the <code>gfn</code>(guest physical frame number) form. I wanted to tell if these <code>gfns</code> were mapped in kernel or userspace. So I traversed the guest's (virtual machine) paging table to find out the corresponding page table entries mapping to these <code>gfns</code>. See my previous question <a href="https://stackoverflow.com/questions/30471742/physical-memory-userspace-kernel-split-on-linux-x86-64/30473375">here</a>.  </p>
  
  <p>I found that the physical addresses of some paging structures are mapped in the paging table while some are not. That is, the physical addresses of some paging structures (such as the address of <code>PT</code> given by a <code>PDE</code>) do not have valid corresponding <code>PTE</code> in the page table. Since I have changed the memory mechanism of the <code>KVM</code> a lot, I am afraid that maybe this phenomenon is caused by my code or maybe there is something wrong with my page-table-walking code.  </p>
  
  <p>So I want to know in a normal Linux, how these stuffs are handled.<br>
  Thanks very much!</p>