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

Re: [Xen-devel] Manual differ from source code about Unrestricted Guest



On Tue, 2011-06-07 at 16:41 +0100, confucius wrote:
> As italics show:
> Some processors allow guest software to run in unpaged protected mode or in
> real-address
> mode, such guest called âunrestricted guestâ.
> If CR0.PG = 0, each linear address is passed directly to the EPT mechanism
> for translation to a physical address.â
> References to Intel 64 and IA-32 Architectures Software Developerâs Manual
> Volume 3B:System Programming Guide, Part 2  22.8 UNRESTRICTED GUESTS
> 
> When we set CR0.PG=0 of a guest, I think it doesnât need construct a page
> table for the unpaged guest, but I found it construct an identify_map table
> for unpaged guest in the source codes of xen. As follow: 
> Xen-4.0/tools/libxc/xc_hvm_build.c 
> setup_guest()
> {
> âââââââ
> /*
>      * Identity-map page table is required for running with CR0.PG=0 when
>      * using Intel EPT. Create a 32-bit non-PAE page directory of
> superpages.
>      */
>     if ( (ident_pt = xc_map_foreign_range(
>               xc_handle, dom, PAGE_SIZE, PROT_READ | PROT_WRITE,
>               special_pfn(SPECIALPAGE_IDENT_PT))) == NULL )
>         goto error_out;
>     for ( i = 0; i < PAGE_SIZE / sizeof(*ident_pt); i++ )
>         ident_pt[i] = ((i << 22) | _PAGE_PRESENT | _PAGE_RW | _PAGE_USER |
>                        _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_PSE);
>     munmap(ident_pt, PAGE_SIZE);
> âââââââ
> }
> 
> Why construct such identity map table for unpaged guest?

AIUI although the guest is in unpaged mode the _host_ is not and
therefore a pagetable is required from somewhere. Since the guest thinks
it is in unpaged mode it isn't going to provide one and therefore the
hypervisor must provide them.

> In my opinion, guset_cr3 doesnât function when set CR0.PG=0, can guest_cr3
> of this unpaged guest point to identity map table?

I don't think so -- the use of this identity map table is transparent to
the guest. The identity map is just part of the business of providing
the illusion of unpaged mode to the guest.

Ian.

> 
> 
> --
> View this message in context: 
> http://xen.1045712.n5.nabble.com/Manual-differ-from-source-code-about-Unrestricted-Guest-tp4462113p4462113.html
> Sent from the Xen - Dev mailing list archive at Nabble.com.
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel



_______________________________________________
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®.