KVM guest memory mapping

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi list,

I've just started doing some research into VM memory allocation, and
I've got a few questions about how KVM performs memory translations
from guest to host, using Intel-VT extensions.  My questions relate to
the implementation of Intel EPTs.

I've put in a few printk statements within the KVM source,
specifically mmu.c to try to follow what is happening within the VM
and hypervisor, however, I'm a little bit lost at what I'm seeing.

The very first virtual memory access from within my guest triggers a
'handle_ept_violation', this is to be expected as it's the very first,
and no pages will have been allocated as of yet.

The value taken from the guest's CR2 register is: 0xfffffff0 (which I
am assuming to be a guest physical address).  Upon this ept violation
occurring, the function tdp_page_fault is called, which then in turn
calls __direct_map.  I'm a little confused about exactly what
__direct_map is actually doing.

The input to __direct_map is:

gpa_t v: fffffff0
gfn_t gfn: fffff
pfn_t pfn: 35b649
level: 1

Firstly, I'm confused as to why the gpa_t type variable is called 'v'.
This would indicate to me that it's a virtual address, however it is
being stored as a guest physical type.  Could anyone explain why this
is named as such?

After this I can see a lot of different memory addresses being passed
around the system, but I'd still like to better understand how KVM
allocates and finally translates guest addresses into host physical
address.  If anyone could help explain how __direct_map functions, I
would appreciate it.

Thanks

Tony
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux