From: "Jan Beulich" Subject: [PATCH] x86 emulation: suppress rep prefix handling on non-repeatable instructions Date: Thu, 15 Feb 2007 09:58:46 +0000 Message-ID: <45D43CE6.76E4.0078.0@novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Otherwise, pause or the recommended one-byte ret workaround on AMD processors may have ill side effects. Signed-off-by: Jan Beulich Index: 2007-02-07/xen/arch/x86/x86_emulate.c =================================================================== --- 2007-02-07.orig/xen/arch/x86/x86_emulate.c 2007-02-08 08:46:39.000000000 +0100 +++ 2007-02-07/xen/arch/x86/x86_emulate.c 2007-02-08 09:32:00.000000000 +0100 @@ -1579,7 +1579,9 @@ x86_emulate( if ( twobyte ) goto twobyte_special_insn; - if ( rep_prefix ) + if ( rep_prefix && + (((b & ~0xf) == 0xa0 && ((0xfcf0 >> (b & 0xf)) & 1)) || + (b & ~3) == 0x6c) ) { if ( _regs.ecx == 0 ) {