OS & Hardware
In nested paging where both guest and host use 4-level page tables, how many memory accesses can a TLB miss require in the worst case?
- A8
- B16
- C24
Show answer and explanation
Answer: C. 24
Each of the guest's four table locations is a guest physical address, so it must be translated through the host's four levels before it can be read. Each guest level costs four host reads plus one guest-table read, five in all, giving 20 for four levels; translating the final guest physical address of the data itself through the host's four levels adds four more, for 24. As a formula, (4 + 1) × (4 + 1) − 1 = 24. Eight assumes simply walking four levels twice, overlooking translation of the table locations.
- A. Eight overlooks translating the guest table locations.
- B. Sixteen simply multiplies 4 × 4.
- C. Correct. (4 + 1) × (4 + 1) − 1 = 24.