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

Re: [Xen-devel] Question about page table used by hypervisor



Hi, 

At 02:42 +0100 on 30 Mar (1301452953), KennyChen wrote:
> Hi, Tim:
> 
> One more doubt here.
> In the Linux concept, each process all share a common part of kernel page
> tables, e.g., 3-4GB address mapping are the same among all processes. Thus 
> when
> switching to kernel, there is no need to change hardware CR3.
> 
> But when going to PV guest, is that the same way?
> I thought Xen prepares the page tables for PV guest in such a way that
> some portion of address mapping is reserved particularly for
> hypervisor, which can be used for translation inside hypervisor.

Yes, PV guests share an address space with the hypervisor, as described
in the original "Xen and the art of virtualization" paper. 

> For PV, it might be ok because the page table is directly translated to 
> machine
> physical address. So when switching to hypervisor, this page table (same cr3)
> can still be used for address translation.
> 
> But how about HVM guest (assume EPT is enabled)?
> When vmexit happens, does the hardware CR3 switches to some other value

Yes; it's called the "host cr3" in the APMs and PRMs. 

, which
> points to a special page table for Xen's use? If no switching happens, then 
> the
> hardware MMU would walk through guest page table for translation which is 
> weird
> to me.
> 
> If such special page table exists, could you point it out?

It's called the "monitor table" in the Xen code. 

Cheers,

Tim.

> Thanks,
> Kenny
> 
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel

-- 
Tim Deegan <Tim.Deegan@xxxxxxxxxx>
Principal Software Engineer, Xen Platform Team
Citrix Systems UK Ltd.  (Company #02937203, SL9 0BG)

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

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