[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] A question about VM's access memory



At 09:35 +0800 on 27 Feb (1361957749), Kai Luo wrote:
> Hi:
>      For a HVM I kown the Xen Hypervisor  maintains a set of shadow
> pages,may be 2 levels or 4 levels.Under normal conditions ,without xen,a
> process wants to  access memory,the system will read CR3 to find the
> physical address of the page tables,then find the physical address of the
> next level,then the next,that will be multiple memory access(ignoring the
> TLB).My question is,when the system runs as a domain of xen, whether it is
> needed to triger a VM-EXIT when the system wants to find the physical
> address of next level of page table,if so when a guest want to access
> memory there will be VM-EXIT many times,if not how the system knows the
> address of next level of page tables ?

If the domain is using shadow pagetables, the MMU walks the _shadow_
pagetables, so it doesn't need to VMEXIT unless the virtual address is
not mapped in the shadow pagetables (or mapped with insufficient access
rights).

In that case it will VMEXIT once and the sh_page_fault() handler will
fix up the shadow pagetables by looking at the guest pagetables and the
p2m.  So there ought to be at most one VMEXIT. 

Cheers,

Tim.

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.