title: How does the MMU/Kernel knows that a PTE is valid?
body: <p>Assuming a two-level page table, let's say the program gets allocated 2 pages (8KB)</p>
  
  <pre><code>  GPD      PD1     PD2      PD3 
  +-----+ +------+ +------+ +------+
  +  1  + +  22  + +------+ +------+
  +  0  + +  62  + +------+ +------+
  +  0  + +  0   + +------+ +------+
  +-----+ +------+ +------+ +------+
  </code></pre>
  
  <p>How does the MMU/kernel knows when a program attempts to access the third entry of PD1 or like the 2,3 entry of GPD?
  Does it initialize the unused PTEs with some value in order to distinguish the unused ones? (like with 0 or something)</p>
  
  <p>I have read in <a href="https://www.kernel.org/doc/gorman/html/understand/understand006.html" rel="nofollow noreferrer">here</a> and there is no valid bit or something in the pte flags</p>