On Wed, Mar 10, 2010 at 04:53:29PM +0200, Avi Kivity wrote:
The basic flow of the mmu state with npt-npt is:
1. As long as the L1 is running the arch.mmu context is in tdp
mode and builds a direct-mapped page table.
2. When vmrun is emulated and the nested vmcb enables nested
paging, arch.mmu is switched to a shadow-mmu mode which now
shadows the l1 nested page table.
So when the l2-guest runs with nested paging the
arch.mmu.tdp_enabled variable on the host is false.
3. On a vmexit emulation the mmu is switched back to tdp
handling state.
So the mmu.tdp_enabled parameter is about tdp being enabled for the
mmu context (so mmu.tdp_enabled means that we build a l1-direct-mapped
page table when true or shadow a l1-page-table when false). Thats why I
think the 'tdp_enabled' name makes sense in the mmu-context.
The global flag only shows if an mmu-context could be in tdp-state. So
tdp_usable may be a good name for it.
Joerg
--