title: Why is the size of a page table entry determined only by main memory size?
body: <p>Excluding the valid, dirty and reference bits, considering only actual "mapping" from virtual address space to physical address space, why is it said that the size of a page table entry is determined by the number of bits required to reference a page from the main memory (Like here: <a href="https://stackoverflow.com/a/14770650/3684931">https://stackoverflow.com/a/14770650/3684931</a>)</p>
  
  <p>My argument is that since a physical address can be in secondary storage too (which is the point of using virtual memory), the size of a page table entry should simply be equal to the number of bits to required to reference any page among all the pages in the virtual memory.</p>
  
  <p><strong>To give an example</strong>, if virtual address space is addressable by 64 bits,  main memory is addressable by 48 bits and page size is 16KB (addressable by 14 bits), a page table should map (64 - 14) 50 bit addresses to (64 - 14) 50 bit addresses and not (48 - 14) 34 bit addresses.</p>
  
  <p>It <em>could</em> map to 34 bit addresses if the page exists in main memory, but otherwise, the upperbound should be 50 bits which should be considered while calculating the size of a page table.</p>
  
  <p>Am I missing something here?</p>