From: Hui Kang Subject: Question about how MMU and shadow page table work in KVM Date: Wed, 8 Jan 2014 15:33:13 +0000 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT To: "kvm@vger.kernel.org" Return-path: Received: from edge1.cs.stonybrook.edu ([130.245.9.210]:33939 "EHLO edge1.cs.stonybrook.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751069AbaAHPim convert rfc822-to-8bit (ORCPT ); Wed, 8 Jan 2014 10:38:42 -0500 Content-Language: en-US Content-ID: <360358E8824104439499FEB8D78D0150@cs.stonybrook.edu> Sender: kvm-owner@vger.kernel.org List-ID: 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