From patchwork Fri Jun 9 16:51:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Pop X-Patchwork-Id: 9778921 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 CBC1460350 for ; Fri, 9 Jun 2017 16:54:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C5494205AD for ; Fri, 9 Jun 2017 16:54:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BA1CF28657; Fri, 9 Jun 2017 16:54:21 +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 677C7205AD for ; Fri, 9 Jun 2017 16:54:19 +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 1dJN8w-0007ge-Rb; Fri, 09 Jun 2017 16:52:14 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dJN8u-0007gC-Sn for xen-devel@lists.xenproject.org; Fri, 09 Jun 2017 16:52:12 +0000 Received: from [193.109.254.147] by server-4.bemta-6.messagelabs.com id 9A/BE-02956-C32DA395; Fri, 09 Jun 2017 16:52:12 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrJIsWRWlGSWpSXmKPExsUSfTxjoa71Jat Ig9WX1C2+b5nM5MDocfjDFZYAxijWzLyk/IoE1oxbc88xFmzirFjV38nWwPiAvYuRk0NIwE1i 7frzjF2MXED2GkaJX/c+MUM4dxklJiw5wgRR5S5x6/YJNojELkaJq++XMYIk2ATUJTbv3cIKY osIKEncWzWZCaSIWeANk8T9VxfAuoUFwiS+7VnFAmKzCKhKfPr1BizOK2ApcfDyFTYQW0JAXu LKr36wGk4BK4knJy5BbbaUaOn+wgJRkyPxe0s/0GIOIFtK4n+rEsguCYEFLBJNvz9D1chIPJp 4k20Co9ACRoZVjBrFqUVlqUW6RqZ6SUWZ6RkluYmZObqGBmZ6uanFxYnpqTmJScV6yfm5mxiB wcgABDsYVy0IPMQoycGkJMo7rcAqUogvKT+lMiOxOCO+qDQntfgQowwHh5IEr91FoJxgUWp6a kVaZg4wLmDSEhw8SiK8L04CpXmLCxJzizPTIVKnGHU5Ono2fGESYsnLz0uVEuc1AZkhAFKUUZ oHNwIWo5cYZaWEeRmBjhLiKUgtys0sQZV/xSjOwagkzBt+HmgKT2ZeCdymV0BHMAEdseSdBcg RJYkIKakGxgWCDk5Kl/7W71tdPCO9O6yrRv6D1nIpRfd7byZtv+Daeo5DQknd/kfTe7OK2sUX LnALLFvSuOKV2rm/WSEfGHPV5wQwXNycuCzrnsrdTymhK67KirOeXv3bt/5BUeurlx2nF1bnx Wu8bz952+OhmGhfrL706jumH+bJ7Ll2pibxf8ryfpkTokosxRmJhlrMRcWJABh80KDMAgAA X-Env-Sender: apop@bitdefender.com X-Msg-Ref: server-5.tower-27.messagelabs.com!1497027131!101453883!1 X-Originating-IP: [91.199.104.161] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.19; banners=-,-,- X-VirusChecked: Checked Received: (qmail 36465 invoked from network); 9 Jun 2017 16:52:11 -0000 Received: from mx01.bbu.dsd.mx.bitdefender.com (HELO mx01.bbu.dsd.mx.bitdefender.com) (91.199.104.161) by server-5.tower-27.messagelabs.com with DHE-RSA-AES128-GCM-SHA256 encrypted SMTP; 9 Jun 2017 16:52:11 -0000 Received: (qmail 9325 invoked from network); 9 Jun 2017 19:52:08 +0300 Received: from unknown (HELO mx-sr.buh.bitdefender.com) (10.17.80.103) by mx01.bbu.dsd.mx.bitdefender.com with AES256-GCM-SHA384 encrypted SMTP; 9 Jun 2017 19:52:08 +0300 Received: from smtp01.buh.bitdefender.com (smtp.bitdefender.biz [10.17.80.75]) by mx-sr.buh.bitdefender.com (Postfix) with ESMTP id D4F527FBF5 for ; Fri, 9 Jun 2017 19:52:08 +0300 (EEST) Received: (qmail 19875 invoked from network); 9 Jun 2017 19:52:08 +0300 Received: from unknown (HELO hel.clj.bitdefender.biz) (apop@bitdefender.com@10.220.12.75) by smtp01.buh.bitdefender.com with AES128-GCM-SHA256 encrypted SMTP; 9 Jun 2017 19:52:08 +0300 From: Adrian Pop To: xen-devel@lists.xenproject.org Date: Fri, 9 Jun 2017 19:51:53 +0300 Message-Id: <20170609165154.23577-2-apop@bitdefender.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170609165154.23577-1-apop@bitdefender.com> References: <20170609165154.23577-1-apop@bitdefender.com> X-BitDefender-Scanner: Clean, Agent: BitDefender qmail 3.1.6 on smtp01.buh.bitdefender.com, sigver: 7.71779 X-BitDefender-Spam: No (0) X-BitDefender-SpamStamp: Build: [Engines: 2.15.8.1074, Dats: 451586, Stamp: 3], Multi: [Enabled, t: (0.000010, 0.007366)], BW: [Enabled, t: (0.000009,0.000001)], RBL DNSBL: [Disabled], APM: [Enabled, Score: 500, t: (0.003630), Flags: 85D2ED72; NN_NO_CONTENT_TYPE; NN_NO_LINK_NMD; NN_LEGIT_BITDEFENDER; NN_LEGIT_S_SQARE_BRACKETS; NN_LEGIT_MAILING_LIST_TO], SGN: [Enabled, t: (0.010534,0.000076)], URL: [Enabled, t: (0.000005, 0.000001)], RTDA: [Enabled, t: (0.132275), Hit: No, Details: v2.5.1; Id: 15.5f480l.1bi6eeger.6d10], total: 0(775) X-BitDefender-CF-Stamp: none Cc: Tamas K Lengyel , Wei Liu , Razvan Cojocaru , Adrian Pop , George Dunlap , Andrew Cooper , Ian Jackson , Jan Beulich , Vlad Ioan Topan Subject: [Xen-devel] [PATCH 1/2] x86/mm: Change default value for suppress #VE in set_mem_access() 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: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Vlad Ioan Topan The default value for the "suppress #VE" bit set by set_mem_access() currently depends on whether the call is made from the same domain (the bit is set when called from another domain and cleared if called from the same domain). This patch changes that behavior to inherit the old suppress #VE bit value if it is already set and to set it to 1 otherwise, which is safer and more reliable. Signed-off-by: Vlad Ioan Topan Signed-off-by: Adrian Pop --- xen/arch/x86/mm/mem_access.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/xen/arch/x86/mm/mem_access.c b/xen/arch/x86/mm/mem_access.c index 5adaf6df90..d0b0767855 100644 --- a/xen/arch/x86/mm/mem_access.c +++ b/xen/arch/x86/mm/mem_access.c @@ -273,8 +273,7 @@ int p2m_set_altp2m_mem_access(struct domain *d, struct p2m_domain *hp2m, } } - return ap2m->set_entry(ap2m, gfn_l, mfn, PAGE_ORDER_4K, t, a, - (current->domain != d)); + return ap2m->set_entry(ap2m, gfn_l, mfn, PAGE_ORDER_4K, t, a, -1); } static int set_mem_access(struct domain *d, struct p2m_domain *p2m,