On Fri, May 14, 2010 at 04:26:11PM +0200, Alexander Graf wrote:
> 
> On 14.05.2010, at 15:15, Matteo Signorini wrote:
> 
> > Hi to all,
> > 
> > I am working on NPT and have some doubts.
> > Please correct me if I am wrong,
> > 
> > In NPT only the first time a page fault happens it is trapped by the host.
> > The following page faults are not trapped by the host in order to
> > reduce page walk overhead.
> > 
> > My question is...
> > 
> > Which Kvm function handles the "nested page fault"?
> 
> The exit code is SVM_EXIT_NPF. Just search for the handler in 
> svm.c:svm_exit_handlers.
> 
>         [SVM_EXIT_NPF]                          = pf_interception,

Which ends up in tdp_page_fault(). This function calls the generic
__direct_map() handler (that is used for real-mode paging too).
Note that nested page faults are different from guest page faults. Guest
page faults occur for guest virtual addresses (and are handled entirely
inside the guest most of the time) while nested page faults occur for
guest physical addresses and are alway handled by kvm.

        Joerg

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

Reply via email to