From: "Kamble, Nitin A" Subject: Re: [PATCH][RFC] Emulating real mode with x86_emulate Date: Fri, 30 Mar 2007 14:08:33 -0700 Message-ID: <1175288913.32115.20.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> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0251414070==" Return-path: Content-class: urn:content-classes:message In-Reply-To: <460D5E34.2080803@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 --===============0251414070== Content-Type: multipart/signed; boundary="=-Mw86ASY+XrrkQhA2BBUJ"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-class: urn:content-classes:message --=-Mw86ASY+XrrkQhA2BBUJ Content-Type: multipart/alternative; boundary="=-yubwWM7stL1B8J8h6Y/H" --=-yubwWM7stL1B8J8h6Y/H Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi Anthony, On Fri, 2007-03-30 at 14:00 -0500, Anthony Liguori wrote: > /* Enter real mode, reload all segment registers and IDT. */ > " ljmp $0x8,$0x0 \n" > "trampoline_start: .code16 \n" > " mov %eax,%cr0 \n" >=20 > That change was pretty recent so unless it was reverted it should Just Wo= rk. >=20 > Regards, >=20 > Anthony Liguori Now I see cr0 is updated after returning from main.=20 I enabled the debug log in the xen code now. (XEN) HVM2: Creating MP tables ... =20 (XEN) HVM2: Loading Cirrus VGABIOS ... =20 (XEN) HVM2: Loading ACPI ... =20 (XEN) HVM2: Loading VMXAssist ... deadbeef =20 (XEN) HVM2: foo =20 (XEN) hvmop_emulate_realmode =20 (XEN) guest requests real mode emulation =20 (XEN) foo 221 =20 (XEN) HVM2: Invoking ROMBIOS ... =20 (XEN) vmx_vmexit_handler called. eip =3D 0x0 =20 (XEN) vmx_cr_access called eip=3D0x0 =20 (XEN) mov_to_cr 0 called eip=3D0x0 =20 (XEN) vmx_set_cr0 called eip=3D0x0 =20 (XEN) Transfering -- control to x86_emulate eip 0x0 =20 (XEN) hvm.c:446:d2 Triple fault on VCPU0 - invoking HVM system reset. =20 It shows cr0 is getting modified. But the eip is still 0x0.=20 =20 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 --=-yubwWM7stL1B8J8h6Y/H Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Anthony,

On Fri, 2007-03-30 at 14:00 -0500, Anthony Liguori wrote:
    /* Enter real mode, reload all segment register=
s and IDT. */
    "    ljmp $0x8,$0x0              \n"<=
/FONT>
    "trampoline_start: .code16       \n"<=
/FONT>
    "    mov  %eax,%cr0              \n"<=
/FONT>

That change was pretty recent so unless it was reve=
rted it should Just Work.

Regards,

Anthony Liguori
Now I see cr0 is updated after returning from main.
   I enabled the debug log in the xen code now.

(XEN) HVM2: Creating MP tables ...       = ;            &n= bsp;            = ;            &n= bsp;
(XEN) HVM2: Loading Cirrus VGABIOS ...      &= nbsp;           &nbs= p;            &= nbsp;         
(XEN) HVM2: Loading ACPI ...        = ;            &n= bsp;            = ;            &n= bsp;     
(XEN) HVM2: Loading VMXAssist ... deadbeef     &nb= sp;            =             &nb= sp;      
(XEN) HVM2: foo          =             &nb= sp;            =             &nb= sp;            =     
(XEN) hvmop_emulate_realmode        = ;            &n= bsp;            = ;            &n= bsp;     
(XEN) guest requests real mode emulation      = ;            &n= bsp;            = ;        
(XEN) foo 221          &n= bsp;            = ;            &n= bsp;            = ;            &n= bsp;     
(XEN) HVM2: Invoking ROMBIOS ...       &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;  
(XEN) vmx_vmexit_handler called. eip =3D 0x0     &= nbsp;           &nbs= p;            &= nbsp;      
(XEN) vmx_cr_access called eip=3D0x0      &nb= sp;            =             &nb= sp;            =  
(XEN) mov_to_cr 0 called eip=3D0x0       = ;            &n= bsp;            = ;            &n= bsp;  
(XEN) vmx_set_cr0 called eip=3D0x0       = ;            &n= bsp;            = ;            &n= bsp;  
(XEN) Transfering -- control to x86_emulate eip 0x0    =             &nb= sp;           
(XEN) hvm.c:446:d2 Triple fault on VCPU0 - invoking HVM system reset. =

It shows cr0 is getting modified. But the eip is still 0x0.


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
--=-yubwWM7stL1B8J8h6Y/H-- --=-Mw86ASY+XrrkQhA2BBUJ 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) iD8DBQBGDXxRZ1sfU7kTCR8RAu7JAJ0QiTfTjFAtNWkE2w+35Dto1bOHFACfZM/y OKVvZoNR+f/3eZg9uqO9w9o= =2FbC -----END PGP SIGNATURE----- --=-Mw86ASY+XrrkQhA2BBUJ-- --===============0251414070== 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 --===============0251414070==--