Search code examples
operating-systemcpu-architecturevirtual-memorytlb

What is meant by invalid page table entry?


From wikipedia:

The page table lookup may fail for two reasons. The first is if there is no translation available for the virtual address, meaning that virtual address is invalid.

Furthermore, if each process has its own page table, this means that the entries in the page table will all have some translation from virtual address to physical address. What is then meant by a page table entry being invalid? If the entry exists, it means that the translation exists, because an entry is nothing but a mapping from a virtual address to physical address.


Solution

  • IMHO, the Wikipedia entry does not handle all cases. For a given virtual address the first step in the translation is to find the corresponding page table entry.

    Problem 1: The page table entry may not exist at all. AN operating system may limit the page table size so that it does not cover the full virtual address range and the specified address is outside that range. This can also occur with multi-level page tables where not all the levels have been filled in.

    Problem 2: The page table entry exists but the page had not been mapped to the virtual address space.

    {these first two are most likely to be classified as invalid pages table entries)

    Problem 3: The page is not in physical memory [Page fault].

    Problem 4: The type of access requested is not permitted in the current processor mode. E.g., User mode write to a page that only permits user mode reads; Kernel mode execute to a page that only permits read and write.