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: Haitao Shan <maillists.shan@xxxxxxxxx>
Subject: Re: [Xen-devel] How EPT translates an X86_32 guest physical address?
From: Superymk <superymkxen@xxxxxxxxxxx>
Date: Tue, 23 Nov 2010 12:41:29 +0800
Cc: George Dunlap <George.Dunlap@xxxxxxxxxxxxx>, "Xen-devel@xxxxxxxxxxxxxxxxxxx" <Xen-devel@xxxxxxxxxxxxxxxxxxx>, Chu Rui <ruichu@xxxxxxxxx>, Ian Campbell <Ian.Campbell@xxxxxxxxxx>
Delivery-date: Mon, 22 Nov 2010 20:42:29 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <AANLkTi=zPN+_=UeY9gGtC379num8MnmLNcgxa5HUVZnu@xxxxxxxxxxxxxx>
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> <1289990998.31507.3506.camel@xxxxxxxxxxxxxxxxxxxxxx> <AANLkTimjjcBS3GujX7XzN1L3bG6YCnxyRt_fn+H0eM2F@xxxxxxxxxxxxxx> <BLU0-SMTP16481E4B6A29A5FDD7236BBA2380@xxxxxxx> <BLU0-SMTP149921D35AE97931DE151B6A23C0@xxxxxxx> <AANLkTikGHRfq7FppHjsaRRJW87mu5nHmsNWbJ6wXasv4@xxxxxxxxxxxxxx> <BLU0-SMTP40A80731C31D24EE62C307A23D0@xxxxxxx> <AANLkTi=zPN+_=UeY9gGtC379num8MnmLNcgxa5HUVZnu@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101027 Thunderbird/3.1.6
Thanks a lot. I'll have a try on it.

Miao

On 11/23/2010 9:05 AM, Haitao Shan wrote:
You can get those memory type information from parsing current MTRR
settings. And then reflecting those via EPT entries.

EPT memory type has two different kinds of settings basically. One is
using EPT memory type directly (ignoring guest PAT settings). The
other one is combined effective memory type derived from EPT memory
type and guest PAT settings, which means EPT memory type is served as
a replacement of MTRRs. I suggest that you use the latter one.

Shan Haitao

2010/11/22 Superymk<superymkxen@xxxxxxxxxxx>:
Thank you very much. My EPT implementation works well now. Currently I am
using UC (Uncachable) type for the EPT PT entries.

By the way, How can I find out which mfn should be WB and which mfn should
be UC? I suppose it incurs some performance overhead if not using WB. Is
there any manual to look up the desirable mfn type on Windows?

Thanks,
Miao

On 11/22/2010 2:49 PM, Haitao Shan wrote:
One difference between EPT-backed 1:1 mapping and direct 1:1 mapping
(I suppose that you don't use shadow page table) is that MTRRs are
ignored when EPT is in effect.
Do you set up EPT memory type correctly? Especially Windows is likely
to access MMIO space below 1M.

Shan Haitao

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

I just implement the EPT support in my hypervisor (Very similar to
Newbluepill). My new problem is irrelevant with Xen.
It's just about how to debug VTx implementation in drivers.

Here is the story. First, I implement a driver support partial VTx, and
it
works very well. Then I implement EPT to identically map gfn to mfn from
0x0
to 0xfffff. I suppose it should be OK. But the result is the Windows OS
hangs (No reboot, No BSOD) when executing VMLAUNCH instruction.

And my problem is that, the windbg just shows "debuggee is running" when
the
debuggee Windows OS hangs, even if I insert "ud2" instruction before the
next statement, #VMEXIT handler and the first instruction in non-root
mode.
VMLAUNCH should not make this happen according to Intel's manual 2B.
Everything is OK if I set "enable ept" to be 0 or clear the "EPT pointer"
field in VMCS. Can someone explain why this happens and what should I do
to
continue debugging?

Both the hypervisor and the Windows OS is on x86_32 platform. I use
windbg
to debug the target machine via serial port.

Some debug information: EPT pointer is 0x9ba801e, (pfn:0x9ba8, flag:0x1e,
I
have double checked this) PML4[0] = 0x00000000_09cd8007, PDPT[0] =
0x00000000_09cf3007, PD[0] = 0x00000000_09cf2007, PT[0] =
0x00000000_00000077. Other entries of the same scheme with different
values.

The debuggee is Intel i5 650, multi-core disabled.

Thanks,
Miao

On 11/17/2010 7:53 PM, Superymk wrote:

Thanks for Ian's answer. it comes to a more general scenario.

Hi Chu, EPT entry is 64 bit long, regardless the hypervisor is on x86_32
platform or x86_64 platform. So there is no difference for the hypervisor
to
use EPT on these two platforms.

On 11/17/2010 7:26 PM, Chu Rui wrote:

Okay, in my mind, the hardware has only one work mode, 32bit or 64bit.
Thus
the 32bit guest address will be extended under the 64bit host.
But what will happen for a 64bit guest under a 32bit host :-)

2010/11/17 Ian Campbell<Ian.Campbell@xxxxxxxxxx>
On Wed, 2010-11-17 at 10:32 +0000, 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.
Even on x86_32 physical addresses are>32 bit (think PAE). cr3 is a
physical address, even if the register which exposes it happens to be
limited to 32 bits. cr3 has probably already been expanded to a full
physical address by the time EPT sees it and I don't think there's any
difference between 32 and 64 bit (at least in this aspect) in how EPT
handles the translation from physical address to machine address.

Ian.

_______________________________________________
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



_______________________________________________
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