On 26/09/19 11:41, Maxim Levitsky wrote: >> Thinking more about it, I suppose that saves memory (the same EPT page >> tables can now be used independent of guest CR0.PG), at the cost of >> making TLB misses a little slower. > Don't really understand what you mean. > Isn't this always the case that EPT and guest paging > are independent (at least when no nesting is involved)?
There are two possibilities: 1) emulate CR0.PG=0 with EPT + identity page - advantage: the EPT pages will be reused once the guest sets CR0.PG=1 - disadvantage: TLB misses have to walk two levels of page tables 2) emulate CR0.PG=0 with EPT disabled. Similar to ept=0, CR3 will point to PAE page tables that do the HVA->GPA transition. - advantage: faster TLB misses - disadvantage: need to build separate page tables for CR0.PG=1 (EPT format) and CR0.PG=0 (PAE format), need to "waste" 4k of GPA space for the identity map Paolo