WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] How EPT translates an X86_32 guest physical address?

To: Superymk <superymkxen@xxxxxxxxxxx>
Subject: Re: [Xen-devel] How EPT translates an X86_32 guest physical address?
From: Chu Rui <ruichu@xxxxxxxxx>
Date: Wed, 17 Nov 2010 19:23:40 +0800
Cc: George Dunlap <George.Dunlap@xxxxxxxxxxxxx>, "Xen-devel@xxxxxxxxxxxxxxxxxxx" <Xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 17 Nov 2010 03:31:13 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=0RrWTkSdo3bcSFIGyMzyhD0scR+/HgoSEaRIDNqZRQk=; b=I5VMGbUV+9AB+emZqL/AI7zMfvZjANASpaMvzSPGmae29wRqW/55lLtuZ+pa24VEU6 9SZs8LYziauUOAPL/pe76OBHdSRhAYABR4VgDNlKk9eq05rO9jMxMrE2lTbDEoq+NwpX q4y8yd2fSWOiI3QrZ01esazbjkcByPsnKacxA=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=fAjBLLrOOUAnnsZhdPfikB8FspY1a9a15E5x2l+0FyAJ9kST8JUxt4oEgN8+0X8Cti oZoREvyFTqvDvL5eEFI4d4rQ9GPs9m7jfulbFq/Wdz+5fPi2z7Ki1nM4sQ8thdVFfJy8 Lo8GzqfHsPQvuxHiOSiIJAeK2mxw2Bx+jsW78=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <BLU0-SMTP13031FF63AA3C3D4CD76518A2380@xxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <BLU0-SMTP80A291F0F92750E38F3084A2380@xxxxxxx> <AANLkTimG4DCtXSJO0xFoSGgJ_8v46j6W4RU=gUwP+i2L@xxxxxxxxxxxxxx> <BLU0-SMTP170F62EE03BF27EE5AC75FCA2380@xxxxxxx> <AANLkTi=Mu0rom3KCDOQV7tsVnr_sq_npEWEW7FxaFp4T@xxxxxxxxxxxxxx> <BLU0-SMTP204EE298B6F47B9A3CB2B67A2380@xxxxxxx> <4CE3AF56.9030503@xxxxxxxxxxxxx> <BLU0-SMTP13031FF63AA3C3D4CD76518A2380@xxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Also thanks to George!  I am just reading p2m-ept.c three hours ago.  As a newbie, it is a hard work for me... wish I could get your kind help later.
2010/11/17 Superymk <superymkxen@xxxxxxxxxxx>
Thanks a lot, George. Also thanks for Chu's material.


On 11/17/2010 6:32 PM, George Dunlap wrote:
The exact implementation of 32-bit mode on a 64-bit capable processor is something only the engineers at Intel know; but logically yes, whatever it does is equivalent to first zero-extending the 32-bit value.

You can see the software implementation in xen/arch/x86/mm/hap/p2m-ept.c:ept_get_entry().  That function is passed an unsigned long, which in 64-bit mode is 64 bits, so at that point any hardware address would have been zero-extended.

 -George

On 17/11/10 10:20, Superymk wrote:
So your point is the guest CR3 needs to be "extended" to 64 bits with
zeroes first, if it is a 32-bit guest. right?

On 11/17/2010 6:11 PM, George Dunlap wrote:
If you're in 64-bit mode and the hardware had a TLB miss for virtual
address of 0xdeadb000, how would the hardware walk the pagetables?
There are 20 bits for the virtual frame number, but each page-table
entry has 9 bits.

It's the exact same situation if the guest cr3 was set to 0xdeadb000.
The indexes into the higher-level tables would simply be zero.

  -George

On Wed, Nov 17, 2010 at 9:40 AM, Superymk<superymkxen@xxxxxxxxxxx>   wrote:
Your figure points out the exactly EPT translation mechanism for an X64
guest.

In the face of an X86_32 guest, how can EPT find the right EPML4 entry when
translating CR3's pfn value into the right mfn value? There are 20 bits for
indexing in total, while each level of EPT paging structure uses only 9 bits
for indexing.


On 11/17/2010 5:20 PM, Chu Rui wrote:

Maybe this figure depicts the process...

The original URL is http://software.intel.com/file/25040

2010/11/17 Superymk<superymkxen@xxxxxxxxxxx>
Hi all,

Can some one please tell me how EPT translates an X86_32 guest physical
address? I have read the Intel's manual, but it seems there is no discussion
about this condition.

My concern is that, the guest CR3 pfn can be considered as being
constituted by two 10 bits indexers for an X86_32 virtual machine. However,
the EPT paging structures is similar with the page tables used on X86_64
platform. which has four 9 bits indexers in its address layout. In addition,
each EPT entry is 64 bits long. Hence, a 4K page can hold at most 512
entries. So, if the guest CR3's pfn is 0xfffff (an X86_32 virtual machine)
and I get a valid EPTP, how EPT will perform the translation?

Thanks,
Superymk

_______________________________________________
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









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