Skip to contentSkip to conversation

Question about how MMU and shadow page table work in KVM

DISCUSSION Hui Kang 1 participant 1 message Jan 8, 2014 KVM

lore
Share & tools
lore

Hui Kang

author
#0 lore raw

Hi,
I am currently studying the mmu implementation in KVM. While I use the Linux trace tool to trace page walking, I have some questions about page fault handling by the mmu of KVM.

The KVM documentation says the mmu will kick in, when there is a page fault in the guest. The MMU translates the guest virtual address (gva) to guest physical address (gpa) and host physical address (hpa).

So I run a C program, which mallocs some memory and touch these memory. The program is run in the guest. I also print out the address of the allocated memory, which is 0x1ca5010 - 0x1ca6010. So these addresses should be the guest virtual address.

My question is that when these gvas are accessed as a process in the guest (i.e., creating page fault from the guest), I can not trace these gva in the mmu of the host. I enable the trace events of kvm_mmu_pagetable_walk, kvm_mmu_paging_element.
However, I can not see those gvas in the trace file.

Is there any trace events I missed in the tracing? Or could anyone point out where is the part of code to handle the guest page fault in KVM? Thanks.

- Hui