From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: Invalid op code emulation for HVM guest and GPF Date: Fri, 23 Mar 2012 19:20:58 +0000 Message-ID: <4F6CCD1A.4090505@citrix.com> References: <20120323114425.07bd6db7@mantra.us.oracle.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------030308080106010508020401" Return-path: In-Reply-To: <20120323114425.07bd6db7@mantra.us.oracle.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: Mukesh Rathor Cc: "Xen-devel@lists.xensource.com" , "kris.van.hees@oracle.com" , Keir Fraser List-Id: xen-devel@lists.xenproject.org --------------030308080106010508020401 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Patch attached. Not tested, but seems logically correct. @Mukesh: Do you mind testing please? -- Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer T: +44 (0)1223 225 900, http://www.citrix.com --------------030308080106010508020401 Content-Type: text/x-patch; name="x86_emulate_nop.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="x86_emulate_nop.patch" # HG changeset patch # Parent 0ecb8ffe61b2ffff4331fcf49487c956ccb297a0 x86_emulate: Force #UD if lock prefix used with NOP instruction. DTRACE uses 0xF0 0x90 0x90 0x90 0x90 (LOCK NOP NOP NOP NOP) to try and recieve a #UD, but currently get GPF instead. Fix x86_emulate, as #UD is the correct exception in this case. Reported-by: Mukesh Rathor Signed-off-by: Andrew Cooper diff -r 0ecb8ffe61b2 xen/arch/x86/x86_emulate/x86_emulate.c --- a/xen/arch/x86/x86_emulate/x86_emulate.c +++ b/xen/arch/x86/x86_emulate/x86_emulate.c @@ -2255,6 +2255,7 @@ x86_emulate( break; case 0x90: /* nop / xchg %%r8,%%rax */ + generate_exception_if(lock_prefix, EXC_UD, -1); if ( !(rex_prefix & 1) ) break; /* nop */ --------------030308080106010508020401 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 --------------030308080106010508020401--