On Thu, 2019-09-26 at 11:33 +0200, Paolo Bonzini wrote: > On 26/09/19 11:24, Maxim Levitsky wrote: > > On Thu, 2019-09-26 at 11:18 +0200, Paolo Bonzini wrote: > > > On 26/09/19 10:59, Maxim Levitsky wrote: > > > > If you mean to ask if there is a way to let guest access use no > > > > paging at all, that is access host physical addresses directly, then > > > > indeed there is no way, since regular non 'unrestricted guest' mode > > > > required both protected mode and paging, and 'unrestricted guest' > > > > requires EPT. Academically speaking it is of course possible to > > > > create paging tables that are 1:1... > > > > > > Not so academically, it's exactly what KVM does. > > > > You mean KVM uses 1:1 EPT pages and no guest paging, > > to allow guest to access host physical address space? > > No, it uses the usual HVA->GPA EPT pages and 1:1 GPA->GVA pages when EPT > is enabled and guest CR0.PG=0. This lets KVM work around the CR0.PG=1 > requirement when unrestricted guest mode. I understand now.
> > 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)? Best regards, Maxim Levitsky