Why guest physical addresses are not the same as the corresponding host virtual addresses in QEMU/KVM? Thanks!
hiharryharryharry at gmail.com
Tue Oct 13 04:30:39 UTC 2020
Thank you very much for your thorough explanations. Please see my
inline replies as follows. Thanks!
On Mon, Oct 12, 2020 at 12:54 PM Sean Christopherson
<sean.j.christopherson at intel.com> wrote:
> No, the guest physical address spaces is not intrinsically tied to the host
> virtual address spaces. The fact that GPAs and HVAs are related in KVM is a
> property KVM's architecture. EPT/NPT has absolutely nothing to do with HVAs.
> As Maxim pointed out, KVM links a guest's physical address space, i.e. GPAs, to
> the host's virtual address space, i.e. HVAs, via memslots. For all intents and
> purposes, this is an extra layer of address translation that is purely software
> defined. The memslots allow KVM to retrieve the HPA for a given GPA when
> servicing a shadow page fault (a.k.a. EPT violation).
> When EPT is enabled, a shadow page fault due to an unmapped GPA will look like:
> GVA -> [guest page tables] -> GPA -> EPT Violation VM-Exit
> The above walk of the guest page tables is done in hardware. KVM then does the
> following walks in software to retrieve the desired HPA:
> GPA -> [memslots] -> HVA -> [host page tables] -> HPA
Do you mean that GPAs are different from their corresponding HVAs when
KVM does the walks (as you said above) in software?
More information about the libvir-list