title: details about page table walks in multi-level paging
body: <p>For the sake of simplicity I will use a concrete example to explain my question. Note that I'm interested in the underlying concepts.</p>
  
  <p>Consider a 2-level paging scheme i.e. we have one page directory table and multiple page tables. In order to translate a virtual address to a physical one we first use the n most significant bits of our virtual address to index the page directory table. From there we obtain the address of a page table. Using the remaining bits of our virtual address we index this page table to find the physical address of our data.</p>
  
  <p>Now I was wondering about the following: Does/Should the page directory table store the virtual or the physical addresses of page tables? </p>
  
  <p>If it stores physical addresses of page tables then that means that we cannot page-out any page tables to disk. But in order to use multi-level paging to save storage we need to be able to page-out page tables to disk. So then we use virtual addresses in the page directory table. But this means that after indexing the page directory table we first have to translate the obtained virtual address which requires another page table walk (and in that page table walk we again have to translate a virtual address etc.). So this does not seem to work as well. </p>
  
  <p>Clearly I missed something important. I am interested in hearing about the concepts behind this as well as actual implementations. Or let me know where I can find that information. </p>