From: "Kamble, Nitin A" Subject: Re: [PATCH][RFC] Emulating real mode with x86_emulate Date: Mon, 2 Apr 2007 11:45:25 -0700 Message-ID: <1175539525.9276.5.camel@lnitindesktop.sc.intel.com> References: <4607074E.1030807@us.ibm.com> <1175203075.27076.17.camel@lnitindesktop.sc.intel.com> <460C4AAE.5020707@us.ibm.com> <1175212362.27076.32.camel@lnitindesktop.sc.intel.com> <460C55BD.5050202@us.ibm.com> <1175216381.27076.39.camel@lnitindesktop.sc.intel.com> <1175221214.27076.43.camel@lnitindesktop.sc.intel.com> <460C8207.8000604@us.ibm.com> <1175280781.32115.13.camel@lnitindesktop.sc.intel.com> <460D5E34.2080803@us.ibm.com> <1175288913.32115.20.camel@lnitindesktop.sc.intel.com> <1175289886.32115.26.camel@lnitindesktop.sc.intel.com> <460D8B1B.6020308@us.ibm.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1854184151==" Return-path: Content-class: urn:content-classes:message In-Reply-To: <460D8B1B.6020308@us.ibm.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Mime-version: 1.0 Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Anthony Liguori Cc: "Yu, Wilfred" , xen-devel@lists.xensource.com, Keir Fraser , "Nakajima, Jun" List-Id: xen-devel@lists.xenproject.org --===============1854184151== Content-Type: multipart/signed; boundary="=-7zzb8C/BBGYtsULfC72o"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-class: urn:content-classes:message --=-7zzb8C/BBGYtsULfC72o Content-Type: multipart/alternative; boundary="=-HOsjeJoeMdoskG7jgM2+" --=-HOsjeJoeMdoskG7jgM2+ Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Fri, 2007-03-30 at 15:11 -0700, Anthony Liguori wrote: > set_cr0 is returning 1 though which should increment eip to the next > instruction. >=20 > I'm a bit perplexed about my eip now and also why your eip is still > 0.=20 > It should be the instruction following the mov cr0. >=20 > Regards, >=20 > Anthony Liguori >=20 Hi Anthony, I don't see any code doing context save/restore like vmx_world_save , vmx_world_restore in the current code for the hyperviser based emulator. Also the function arch_vmx_do_resume() is called at the time of vcpu schedule, so it is not right to call the vmx_do_emulate() from there. The code would need vmx_world_save/restore in the code path before returning to vmx_asm_vmexit_handler from vmx_vmexit_handler. Without that I don't see it can emulate any instructions. Thanks & Regards, Nitin=20 Open Source Technology Center, Intel Corporation. ------------------------------------------------------------------------- The mind is like a parachute; it works much better when it's open.=20 --=-HOsjeJoeMdoskG7jgM2+ Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable Re: [PATCH][RFC] Emulating real mode with x86_emulate On Fri, 2007-03-30 at 15:11 -0700, Anthony Liguori wrote:

set_cr0 is returning 1 though = which should increment eip to the next
instruction.

I'm a bit perplexed about my e= ip now and also why your eip is still 0. 
It should be the instruction f= ollowing the mov cr0.

Regards,

Anthony Liguori<= BR>

Hi Anthony,
    I don't see any code doing context save/restore like vmx= _world_save , vmx_world_restore in the current code for the hyperviser base= d emulator.
Also the function  arch_vmx_do_resume() is called at the time of vcpu = schedule, so it is not right to call the  vmx_do_emulate() from there.=

The code would need vmx_world_save/restore in the code path before returnin= g to vmx_asm_vmexit_handler from vmx_vmexit_handler.
Without that I don't see it can emulate any instructions.

Thanks & Regards,
Nitin
Open Source Technology Center, Int= el Corporation.
----------------------------------= ---------------------------------------
The mind is like a parachute; it w= orks much better when it's open.=20
--=-HOsjeJoeMdoskG7jgM2+-- --=-7zzb8C/BBGYtsULfC72o Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQBGEU9BZ1sfU7kTCR8RAhCZAJ9P2xv8q0i4jqw/PTjosuVCiasNVQCfWxj9 n2JwApW+SX+K/vqhn3SS1bU= =aEGs -----END PGP SIGNATURE----- --=-7zzb8C/BBGYtsULfC72o-- --===============1854184151== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============1854184151==--