From patchwork Tue Jul 18 15:25:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Pop X-Patchwork-Id: 9848727 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 D783A602A7 for ; Tue, 18 Jul 2017 15:28:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D480C24B48 for ; Tue, 18 Jul 2017 15:28:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C977E26E49; Tue, 18 Jul 2017 15:28:15 +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 B26A327E5A for ; Tue, 18 Jul 2017 15:28:14 +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 1dXUNw-00012V-Jc; Tue, 18 Jul 2017 15:26:04 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dXUNv-000129-HS for xen-devel@lists.xenproject.org; Tue, 18 Jul 2017 15:26:03 +0000 Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id 76/89-01732-A882E695; Tue, 18 Jul 2017 15:26:02 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrLIsWRWlGSWpSXmKPExsUSfTxjoW6XRl6 kwc4rPBbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8atuecYCzZxVqzq72RrYHzA3sXIySEk4C4x 7+xCIJsLyF7LKDH34koWCOcuo0Tb1+2MEFUeEtf/v4ZK7GaU2PDsDhNIgk1AXWLz3i2sILaIg JLEvVWTmUCKmAXeMEncf3UBrEhYIFKi6cRJsCIWAVWJhw+usIDYvAKWEvOWT2QDsSUE5CWu/O oHi3MKWEksbWgAqucA2mYpMX2OKogpIZAj8WZ6JoQpJfG/VQlkk4RAL4tE5/e/jBBTZCQeTbz JNoFRaAEjwypGjeLUorLUIl0jE72kosz0jJLcxMwcXUMDY73c1OLixPTUnMSkYr3k/NxNjMBA rGdgYNzB+Oq43yFGSQ4mJVHercp5kUJ8SfkplRmJxRnxRaU5qcWHGGU4OJQkeGerA+UEi1LTU yvSMnOAMQGTluDgURLh/QmS5i0uSMwtzkyHSJ1iNObo6NnwhYnj1YT/35iEWPLy81KlxHkng5 QKgJRmlObBDYLF6iVGWSlhXkYGBgYhnoLUotzMElT5V4ziHIxKwrzMwMgX4snMK4Hb9wroFCa gU4R9c0BOKUlESEk1MAa9uWLi+fNDmc4qpvx6Fe1NNVZvlt3tTNz/9gMj9/3dxa7Cqxz/svsG v53Rark+QqDwZMpNmVPnIpp049vuF/54FbNxusW1DVH2Z34ZRAcvPnjht808M9F71/gtM7NZ8 w/Mirspscc2a3GH9OvbFxgdvfhqC29EbLZitp3AGX6uPVZjkU7ZCyWW4oxEQy3mouJEAEa1GR /QAgAA X-Env-Sender: apop@bitdefender.com X-Msg-Ref: server-3.tower-31.messagelabs.com!1500391561!106014643!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.25; banners=-,-,- X-VirusChecked: Checked Received: (qmail 36707 invoked from network); 18 Jul 2017 15:26:02 -0000 Received: from mx01.bbu.dsd.mx.bitdefender.com (HELO mx01.bbu.dsd.mx.bitdefender.com) (91.199.104.161) by server-3.tower-31.messagelabs.com with DHE-RSA-AES128-GCM-SHA256 encrypted SMTP; 18 Jul 2017 15:26:02 -0000 Received: (qmail 3195 invoked from network); 18 Jul 2017 18:26:01 +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; 18 Jul 2017 18:26:01 +0300 Received: from smtp02.buh.bitdefender.net (smtp.bitdefender.biz [10.17.80.76]) by mx-sr.buh.bitdefender.com (Postfix) with ESMTP id 3B2FA7FCB5 for ; Tue, 18 Jul 2017 18:26:01 +0300 (EEST) Received: (qmail 11716 invoked from network); 18 Jul 2017 18:26:01 +0300 Received: from unknown (HELO hel.clj.bitdefender.biz) (apop@bitdefender.com@10.220.12.75) by smtp02.buh.bitdefender.net with AES128-GCM-SHA256 encrypted SMTP; 18 Jul 2017 18:26:00 +0300 From: Adrian Pop To: xen-devel@lists.xenproject.org Date: Tue, 18 Jul 2017 18:25:46 +0300 Message-Id: <20170718152547.14006-2-apop@bitdefender.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170718152547.14006-1-apop@bitdefender.com> References: <20170718152547.14006-1-apop@bitdefender.com> X-BitDefender-Scanner: Clean, Agent: BitDefender qmail 3.1.6 on smtp02.buh.bitdefender.net, sigver: 7.72384 X-BitDefender-Spam: No (0) X-BitDefender-SpamStamp: Build: [Engines: 2.15.8.1074, Dats: 455325, Stamp: 3], Multi: [Enabled, t: (0.000008, 0.004561)], BW: [Enabled, t: (0.000008)], RBL DNSBL: [Disabled], APM: [Enabled, Score: 500, t: (0.002291), 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.011643,0.000064)], URL: [Enabled, t: (0.000005)], RTDA: [Enabled, t: (0.200353), Hit: No, Details: v2.6.3; Id: 15.5f40og.1blaa61fb.9ot2], 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 v3 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,