From: "Jan Beulich" Subject: [PATCH] x86: add movnti emulation Date: Fri, 17 Oct 2008 16:16:29 +0100 Message-ID: <48F8C86D.76E4.0078.0@novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable 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 Linux added the use of movnti for copying from user to kernel space in certain cases, and as per reports we got this may happen with the destination being in MMIO. Signed-off-by: Jan Beulich Index: 2008-09-19/xen/arch/x86/x86_emulate/x86_emulate.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- 2008-09-19.orig/xen/arch/x86/x86_emulate/x86_emulate.c 2008-08-29 = 14:26:56.000000000 +0200 +++ 2008-09-19/xen/arch/x86/x86_emulate/x86_emulate.c 2008-10-17 = 16:34:02.000000000 +0200 @@ -236,7 +236,8 @@ static uint8_t twobyte_table[256] =3D { DstReg|SrcMem|ModRM, DstReg|SrcMem|ModRM, ByteOp|DstReg|SrcMem|ModRM|Mov, DstReg|SrcMem16|ModRM|Mov, /* 0xC0 - 0xC7 */ - ByteOp|DstMem|SrcReg|ModRM, DstMem|SrcReg|ModRM, 0, 0, + ByteOp|DstMem|SrcReg|ModRM, DstMem|SrcReg|ModRM, + 0, DstMem|SrcReg|ModRM|Mov, 0, 0, 0, ImplicitOps|ModRM, /* 0xC8 - 0xCF */ ImplicitOps, ImplicitOps, ImplicitOps, ImplicitOps, @@ -3910,6 +3911,12 @@ x86_emulate( } goto add; =20 + case 0xc3: /* movnti */ + /* Ignore the non-temporal hint for now. */ + generate_exception_if(dst.bytes <=3D 2, EXC_UD, -1); + dst.val =3D src.val; + break; + case 0xc7: /* Grp9 (cmpxchg8b/cmpxchg16b) */ { unsigned long old[2], exp[2], new[2]; unsigned int i;