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

RE: [Xen-devel] Question on p2m table

> Date: Tue, 31 May 2011 10:29:11 +0100
> Subject: Re: [Xen-devel] Question on p2m table
> From: George.Dunlap@xxxxxxxxxxxxx
> To: tinnycloud@xxxxxxxxxxx
> CC: xen-devel@xxxxxxxxxxxxxxxxxxx
> 2011/5/30 MaoXiaoyun <tinnycloud@xxxxxxxxxxx>:
> > Hi:
> >
> >   Question might be simple but really confused me a long time.
> >
> >   In my assumption, during VM running, the CPU sees the guest code
> > instruction,
> > so when it want to asscess memory, it sees the guest virtual adress(GVA), so
> > it need to
> > first translate to guest physical adress(GPA), and then host physical
> > adress(HPA), and finally
> > access the real memory address.
> >
> > Since GPA are always needs to translated to HPA, and p2m table only
> > accessable in Xen for
> > HVM guest, does this mean every memory access will need VMExit to Xen?
> No.
> How the translation happens depends on the mode you're running in:
> shadow or HAP.
> As you know, in non-virtualization mode, the hardware will translate a
> virtual address to a physical address by walking the page tables, and
> placing the resulting translation in the TLB.
> For fully virtualized VMs, as you say, the guest page tables are using
> guest PFNs, which need to be translated into hardware pages (MFNs)
> before they can be used.
> In shadow mode, the hypervisor keeps a set of "shadow" pagetables,
> which are translated versions of the guest pagetables. The hardware
> walks these shadow page tables in exactly the same way as it does when
> not virtualized. This means that Xen has to be involved whenever the
> guest's *page tables* are changed, but not on every access to guest
> memory.
> In HAP mode, the hypervisor tells the hardware where to find the p2m
> table, and the hardware does the translation itself -- walking Xen's
> p2m table just as it walks the guest's page tables.
> In neither case is Xen involved on every memory access.
> Does that make sense?
Actually I want to know how shadown page table and EPT works in detail.
Before further help from you, I will dig deeper myself.
Thanks for kindly help.

> -George

Xen-devel mailing list



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