Search⌘ K

Who Handles The TLB Miss?

Understand the mechanisms behind handling TLB misses, comparing hardware-managed TLBs in CISC systems with software-managed TLBs in RISC architectures. Learn how operating systems respond to TLB misses, the role of trap handlers, and key differences between valid bits in TLBs and page tables, enabling you to grasp efficient virtual memory management.

We'll cover the following...

One question that we must answer: who handles a TLB miss? Two answers are possible: the hardware, or the software (OS).

Hardware handling TLB miss

In the olden days, the hardware had complex instruction sets (sometimes called CISC, for complex-instruction set computers) and the people who built the hardware didn’t much trust those sneaky OS people. Thus, the hardware would handle the TLB miss entirely. To do this, the hardware has to know exactly where the page tables are located in memory (via a page-table base register, used in Line 11 in the code snippet captioned TLB Control Flow Algorithm), as well as their exact format; on a miss, the hardware would “walk” the page table, find the correct page-table entry and extract the desired translation, update the TLB with the translation, and retry the instruction. An example of an “older” architecture that has hardware-managed TLBs is the Intel x86 architecture, which uses a fixed multi-level page table (see the next chapter for details); the current page table is pointed to by the CR3 register“Intel 64 and IA-32 Architectures Software Developer’s Manuals” by Intel, 2009. Available: http://www.intel.com/products/processor/manuals. In particular, pay attention to “Volume 3A: System Programming Guide” Part 1 and “Volume 3B: System Programming Guide Part 2”..

Software-managed TLB

More modern architectures (e.g., MIPS R10k“MIPS R4000 Microprocessor User’s Manual”. by Joe Heinrich. Prentice-Hall, June 1993. Available: http://cag.csail.mit.edu/raw/ . documents/R4400 Uman book Ed2.pdf A manual, one that is surprisingly readable. Or is it? or ...