From patchwork Wed May 18 14:49:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 9119931 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B54A6BF29F for ; Wed, 18 May 2016 14:50:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E81A62034A for ; Wed, 18 May 2016 14:50:57 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 252C420320 for ; Wed, 18 May 2016 14:50:57 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b32mb-0001Pi-6h; Wed, 18 May 2016 14:49:09 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b32mZ-0001PN-Ih for xen-devel@lists.xenproject.org; Wed, 18 May 2016 14:49:07 +0000 Received: from [193.109.254.147] by server-7.bemta-14.messagelabs.com id E8/89-03757-2E08C375; Wed, 18 May 2016 14:49:06 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrEIsWRWlGSWpSXmKPExsXS6fjDS/dRg02 4wbNTnBbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8bW6T0sBU3CFX/bAxoYe/m6GDk4hATyJF4+ Cehi5OTgFbCTuLbvEiOILSFgKLFv/io2EJtFQFVi/raNTCA2m4C6RNuz7awgrSICBhLnjiaBm MwCmRLPfwaCVAgLREl8uHKUCSTMKyAo8XeHMEiYGWR463b2CYxcsxAys5BkIGwtiYe/brFA2N oSyxa+Zp4FNl9aYvk/Doiwo8T2I61oSkBsH4kP6y6xLGDkWMWoUZxaVJZapGtoppdUlJmeUZK bmJmja2hoopebWlycmJ6ak5hUrJecn7uJERh29QwMjDsYv572PMQoycGkJMrrXGETLsSXlJ9S mZFYnBFfVJqTWnyIUYaDQ0mC17YeKCdYlJqeWpGWmQOMAJi0BAePkgivGUiat7ggMbc4Mx0id YpRUUqcNw4kIQCSyCjNg2uDRd0lRlkpYV5GBgYGIZ6C1KLczBJU+VeM4hyMSsK8ViBTeDLzSu CmvwJazAS0+JYY2OKSRISUVAOjSLKLlFPuYctDPrNn1f3RXCWTN+f4c749Nh8ezH+otIT1x+r 3GmYBVc+dbtx7daUmPHsy302bvwrMPO/XRhiqNouqHOK79MstOuzAykNVryqmGLHtkXyu13a6 9fxu1R0ZH3pOiy9TMr4xTdzh6k+O9T9LMv/McQ/75nf9+e0j2xpllrhovc1VU2Ipzkg01GIuK k4EACSBE721AgAA X-Env-Sender: JBeulich@suse.com X-Msg-Ref: server-14.tower-27.messagelabs.com!1463582943!30164465!1 X-Originating-IP: [137.65.248.74] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.34; banners=-,-,- X-VirusChecked: Checked Received: (qmail 44011 invoked from network); 18 May 2016 14:49:05 -0000 Received: from prv-mh.provo.novell.com (HELO prv-mh.provo.novell.com) (137.65.248.74) by server-14.tower-27.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 18 May 2016 14:49:05 -0000 Received: from INET-PRV-MTA by prv-mh.provo.novell.com with Novell_GroupWise; Wed, 18 May 2016 08:49:03 -0600 Message-Id: <573C9CFD02000078000EC9FF@prv-mh.provo.novell.com> X-Mailer: Novell GroupWise Internet Agent 14.2.0 Date: Wed, 18 May 2016 08:49:01 -0600 From: "Jan Beulich" To: "xen-devel" Mime-Version: 1.0 Cc: Andrew Cooper , Wei Liu , wogiz@openmailbox.org Subject: [Xen-devel] [PATCH] x86emul: suppress writeback upon unsuccessful MMX/SSE/AVX insn emulation X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This in particular prevents updating guest IP when handling the retry needed to forward the memory access to qemu. Signed-off-by: Jan Beulich x86emul: suppress writeback upon unsuccessful MMX/SSE/AVX insn emulation This in particular prevents updating guest IP when handling the retry needed to forward the memory access to qemu. Signed-off-by: Jan Beulich --- a/xen/arch/x86/x86_emulate/x86_emulate.c +++ b/xen/arch/x86/x86_emulate/x86_emulate.c @@ -4178,6 +4178,8 @@ x86_emulate( if ( !rc && (b & 1) && (ea.type == OP_MEM) ) rc = ops->write(ea.mem.seg, ea.mem.off, mmvalp, ea.bytes, ctxt); + if ( rc ) + goto done; dst.type = OP_NONE; break; } @@ -4430,6 +4432,8 @@ x86_emulate( if ( !rc && (b != 0x6f) && (ea.type == OP_MEM) ) rc = ops->write(ea.mem.seg, ea.mem.off, mmvalp, ea.bytes, ctxt); + if ( rc ) + goto done; dst.type = OP_NONE; break; } Reviewed-by: Andrew Cooper --- a/xen/arch/x86/x86_emulate/x86_emulate.c +++ b/xen/arch/x86/x86_emulate/x86_emulate.c @@ -4178,6 +4178,8 @@ x86_emulate( if ( !rc && (b & 1) && (ea.type == OP_MEM) ) rc = ops->write(ea.mem.seg, ea.mem.off, mmvalp, ea.bytes, ctxt); + if ( rc ) + goto done; dst.type = OP_NONE; break; } @@ -4430,6 +4432,8 @@ x86_emulate( if ( !rc && (b != 0x6f) && (ea.type == OP_MEM) ) rc = ops->write(ea.mem.seg, ea.mem.off, mmvalp, ea.bytes, ctxt); + if ( rc ) + goto done; dst.type = OP_NONE; break; }