From patchwork Thu Sep 7 08:14:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 9941745 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3EECF6035F for ; Thu, 7 Sep 2017 08:16:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1BDA52856C for ; Thu, 7 Sep 2017 08:16:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1056B2856E; Thu, 7 Sep 2017 08:16:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 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.wl.linuxfoundation.org (Postfix) with ESMTPS id 2E8A728572 for ; Thu, 7 Sep 2017 08:16:53 +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 1dprx2-0003XG-Oe; Thu, 07 Sep 2017 08:14:16 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dprx1-0003XA-LV for xen-devel@lists.xenproject.org; Thu, 07 Sep 2017 08:14:15 +0000 Received: from [85.158.143.35] by server-1.bemta-6.messagelabs.com id 82/7C-03414-6DFF0B95; Thu, 07 Sep 2017 08:14:14 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrJIsWRWlGSWpSXmKPExsXS6fjDS/fa/w2 RBh+mClh83zKZyYHR4/CHKywBjFGsmXlJ+RUJrBkvWx6wFUzgrDi56yFLA+Mqti5GTg4hgTyJ le/aWEBsXgE7ienHD4HFJQQMJU4vvAkU5+BgEVCV2NamDxJmE1CXaHu2nRUkLCJgIHHuaBJIm FkgSqJv+VUmEFtYwF+i4+dJRojpdhKnTveygZTzCghK/N0hDFGuJfHw1y0WCFtbYtnC18wgJc wC0hLL/3FMYOSdhdAwC0nDLCQNsxAaFjCyrGLUKE4tKkst0jW00EsqykzPKMlNzMzRNTQw08t NLS5OTE/NSUwq1kvOz93ECAwwBiDYwXhzY8AhRkkOJiVR3stq6yOF+JLyUyozEosz4otKc1KL DzHKcHAoSfC2/dsQKSRYlJqeWpGWmQMMdZi0BAePkghvFEiat7ggMbc4Mx0idYrRmGPVhCt/m Dg6bt79wyTEkpeflyolzvsOpFQApDSjNA9uECwGLzHKSgnzMgKdJsRTkFqUm1mCKv+KUZyDUU mY9xLIFJ7MvBK4fa+ATmECOqXkOdgpJYkIKakGRpZ165fvVVmSs5pDYR0ru1eBTkCxkHP6Naa g3w+zd/36ZL560bGLX/QWx/uU2awrecV2xHD3/seOElKhbBLHi3k3XXSc41wxb+rHSLXPSq8v 9162FuyJKbScWrgty66JY0uV/ywjvbTVa8N/lx5+5HXjW2T7toeGLVxin/mTLP58TW8uT7lxS ImlOCPRUIu5qDgRAEsj6Be8AgAA X-Env-Sender: JBeulich@suse.com X-Msg-Ref: server-10.tower-21.messagelabs.com!1504772052!74986480!1 X-Originating-IP: [137.65.248.74] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 49694 invoked from network); 7 Sep 2017 08:14:13 -0000 Received: from prv-mh.provo.novell.com (HELO prv-mh.provo.novell.com) (137.65.248.74) by server-10.tower-21.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 7 Sep 2017 08:14:13 -0000 Received: from INET-PRV-MTA by prv-mh.provo.novell.com with Novell_GroupWise; Thu, 07 Sep 2017 02:14:11 -0600 Message-Id: <59B11BF302000078001781EC@prv-mh.provo.novell.com> X-Mailer: Novell GroupWise Internet Agent 14.2.2 Date: Thu, 07 Sep 2017 02:14:11 -0600 From: "Jan Beulich" To: "xen-devel" References: <59B11BF302000078001781EC@prv-mh.provo.novell.com> Mime-Version: 1.0 Content-Disposition: inline Cc: Andrew Cooper , Paul Durrant Subject: [Xen-devel] [PATCH] x86/HVM: drop bogus #PF raising from linear->phys translation 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-Virus-Scanned: ClamAV using ClamSMTP Translations spanning a page boundary not resulting in physically contiguous addresses is not a reason to raise #PF. In fact by not doing so accesses of this kind are being emulated correctly thanks to the fallback logic in the insn emulator's REP MOVS/STOS/INS/OUTS handling (non-string accesses to such locations are being split elsewhere and hence have been working fine already). Signed-off-by: Jan Beulich Reviewed-by: Paul Durrant --- a/xen/arch/x86/hvm/emulate.c +++ b/xen/arch/x86/hvm/emulate.c @@ -566,15 +566,12 @@ static int hvmemul_linear_to_phys( if ( pfec & (PFEC_page_paged | PFEC_page_shared) ) return X86EMUL_RETRY; done /= bytes_per_rep; - *reps = done; if ( done == 0 ) { ASSERT(!reverse); - if ( npfn != gfn_x(INVALID_GFN) ) - return X86EMUL_UNHANDLEABLE; - x86_emul_pagefault(pfec, addr & PAGE_MASK, &hvmemul_ctxt->ctxt); - return X86EMUL_EXCEPTION; + return X86EMUL_UNHANDLEABLE; } + *reps = done; break; }