From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keir Fraser Subject: Re: [PATCH] x86: emulate lea with two register operands correctly Date: Thu, 05 Jan 2012 15:49:55 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: David Vrabel , xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On 05/01/2012 15:03, "David Vrabel" wrote: > An lea instruction with two register operands should raise an > undefined instruction exception. > > Skype does such a instruction and will crash when starting if it does > not get the exception. Thanks. I think it is a little nicer to check ea.type != OP_MEM, so I made that change before committing this patch. It's now in xen-unstable staging. It's a bit concerning that we're emulating LEA at all, perhaps. I wonder if a pagetable page has been reused as a code page and we didn't notice yet? Or is there some other reason that skype is getting emulated? :-) -- Keir > Signed-off-by: David Vrabel > > diff -r efaa28639a71 -r e25b7798f13b xen/arch/x86/x86_emulate/x86_emulate.c > --- a/xen/arch/x86/x86_emulate/x86_emulate.c Wed Jan 04 16:12:44 2012 +0000 > +++ b/xen/arch/x86/x86_emulate/x86_emulate.c Thu Jan 05 14:58:56 2012 +0000 > @@ -2240,6 +2240,7 @@ x86_emulate( > } > > case 0x8d: /* lea */ > + generate_exception_if(modrm_mod == 3, EXC_UD, -1); > dst.val = ea.mem.off; > break; > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel