On Mon, Mar 30, 2015 at 3:00 PM, HANNAS YAYA Issa
<issa.hannasy...@enseeiht.fr> wrote:
> Hi
> When there is a page fault the trapper of the page fault in the hypervisor
> is do_page_fault in xen/arch/x86/traps.c right?

That's for PV guests.  For HVM guests, the page fault causes a VMEXIT,
which will be handled in
xen/arch/x86/hvm/vmx/vmx.c:vmx_vmexit_handler()  (on Intel).

> in this funcion i found a method read_cr2() which return the virtual adrress
> of the page who generate the page fault.
> My question is : is it possible to get the machine address of the page table
> entry for this virtual address?

In general the way you have to do that is to use the virtual address
to walk the guest's pagetables (exactly the same way the hardware
would do on a TLB miss).

For HVM guests (or PV guests in shadow mode) there's already code to
do walk for you in xen/arch/x86/mm/guest_walk.c:guest_walk().  You can
see how it's called from the HAP code and the shadow code if you want.

I don't immediately see a walker for PV guests.

 -George

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

Reply via email to