From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tamas K Lengyel Subject: Re: Failed vm entry with heavy use of emulator Date: Tue, 5 Jan 2016 15:16:34 +0100 Message-ID: References: <568BAF7E.802@citrix.com> <568BC7A2.3020901@bitdefender.com> <568BC9D8.8030709@citrix.com> <568BCCD5.1060203@bitdefender.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7811997867297032124==" Return-path: In-Reply-To: <568BCCD5.1060203@bitdefender.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Razvan Cojocaru Cc: Andrew Cooper , Xen-devel List-Id: xen-devel@lists.xenproject.org --===============7811997867297032124== Content-Type: multipart/alternative; boundary=001a114e406a8e37dd052896e247 --001a114e406a8e37dd052896e247 Content-Type: text/plain; charset=UTF-8 On Tue, Jan 5, 2016 at 3:01 PM, Razvan Cojocaru wrote: > On 01/05/2016 03:49 PM, Andrew Cooper wrote: > > On 05/01/16 13:39, Razvan Cojocaru wrote: > >> Here's a quick log of the emulated instructions on my setup: > >> http://pastebin.com/raw/XXQ0Lnzh > > > > Hmm - according to that, the final instruction emulated was > > > > d1v0 32bit @ 0008:828925db -> fa > > > > which is the 'cli' instruction. > > > > I would start there - I doubt it is an instruction which is emulated > often. > > My code (arch/x86/x86_emulate/x86_emulate.c) does have a case label for it: > > 3677 case 0xfa: /* cli */ > 3678 generate_exception_if(!mode_iopl(), EXC_GP, 0); > 3679 _regs.eflags &= ~EFLG_IF; > 3680 break; > > Maybe the IOPL test fails there? Tamas, does your guest die after a CLI > as well? > I've added a gdprintk(XENLOG_DEBUG, "emulate 0xfa cli\n"); into that switch case but it wasn't printed before the guest crashed. Tamas --001a114e406a8e37dd052896e247 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


On Tue, Jan 5, 2016 at 3:01 PM, Razvan Cojocaru <<= a href=3D"mailto:rcojocaru@bitdefender.com" target=3D"_blank">rcojocaru@bit= defender.com> wrote:
On 01/05/2016 03:49 PM, Andrew Cooper wrote:<= br> > On 05/01/16 13:39, Razvan Cojocaru wrote:
>> Here's a quick log of the emulated ins= tructions on my setup:
>> http://pastebin.com/raw/XXQ0Lnzh
>
> Hmm - according to that, the final instruction emulated was
>
> d1v0 32bit @ 0008:828925db -> fa
>
> which is the 'cli' instruction.
>
> I would start there - I doubt it is an instruction which is emulated o= ften.

My code (arch/x86/x86_emulate/x86_emulate.c) does have a case label = for it:

3677=C2=A0 =C2=A0 =C2=A0case 0xfa: /* cli */
3678=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0generate_exception_if(!mode_iopl(), E= XC_GP, 0);
3679=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0_regs.eflags &=3D ~EFLG_IF;
3680=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0break;

Maybe the IOPL test fails there? Tamas, does your guest die after a CLI
as well?

I've added a gdprintk(XENL= OG_DEBUG, "emulate 0xfa cli\n"); into that switch case but it was= n't printed before the guest crashed.

Tamas
=
--001a114e406a8e37dd052896e247-- --===============7811997867297032124== 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.xen.org http://lists.xen.org/xen-devel --===============7811997867297032124==--