From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: Some questions about processing page fault in kvm Date: Sun, 25 Jul 2010 11:52:51 +0300 Message-ID: <4C4BFB63.2000700@redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: "Gu, Zhongshu" Return-path: Received: from mx1.redhat.com ([209.132.183.28]:10417 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751783Ab0GYIwy (ORCPT ); Sun, 25 Jul 2010 04:52:54 -0400 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On 07/23/2010 06:02 PM, Gu, Zhongshu wrote: > Hi all: > I have some confusion when looking at the code to process page > fault. If there is vm exit caused by page fault, what is the timing of > this vm exit? In my understanding that it will vm exit before entering > the page fault handler in the kernel. Yes. Some page faults are delivered directly to the guest, though. These are all guest faults with ept or npt enabled, and some not-present faults on Intel in shadow mode. > But when it enters vm again, > will it enter the guest kernel's page fault handler again? What do you mean "again"? It will enter the guest fault handler if it is a guest fault. > And another problem is that prefetch_page in paging_tmpl.h is > used to optimize kvm to reduce the number of vm exit. Is there any > possibility to bypass the guest page fault? I mean all the page faults > are delegated to kvm to process, no matter it is the page fault of > guest page table or shadow page table. Not all. See shadow_notrap_nonpresent_pte. -- error compiling committee.c: too many arguments to function