From patchwork Fri Oct 14 00:00:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tamas Lengyel X-Patchwork-Id: 9375973 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 75E8F60839 for ; Fri, 14 Oct 2016 00:03:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5914C2A233 for ; Fri, 14 Oct 2016 00:03:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 493442A236; Fri, 14 Oct 2016 00:03:28 +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.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID 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 960C02A233 for ; Fri, 14 Oct 2016 00:03:27 +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 1bupw5-0007pP-IP; Fri, 14 Oct 2016 00:01:17 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bupw3-0007pJ-W5 for xen-devel@lists.xenproject.org; Fri, 14 Oct 2016 00:01:16 +0000 Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id D5/B9-09561-B4020085; Fri, 14 Oct 2016 00:01:15 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupnkeJIrShJLcpLzFFi42K5GHrgoK6nAkO EwZLb+hbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8bBqW2MBe84Kh5cuMrWwPiBrYuRi0NIYAaj RHfPXfYuRk4OFoE3LBITPsqCJCQE3rFI7Hk0iQ0kISEQI3GqfwsLhF0pcWjyHEYQW0hAU+Lgh jPMEJMmMUlsO3sFbBKbgJHE1as9YM0iAkoS91ZNZgIpYhZYwyixeVM/K0hCWCBaYubrFVCrVS VWT/wHNpVXwF7iYvtBRohtchKXtn1hnsDIt4CRYRWjRnFqUVlqka6RhV5SUWZ6RkluYmaOrqG BqV5uanFxYnpqTmJSsV5yfu4mRmCw1DMwMO5g7Fvld4hRkoNJSZT3l9//cCG+pPyUyozE4oz4 otKc1OJDjDIcHEoSvFPkGCKEBItS01Mr0jJzgGELk5bg4FES4S2VBUrzFhck5hZnpkOkTjEac 2z5fW0tE8e2qffWMgmx5OXnpUqJ80rLA5UKgJRmlObBDYLF0yVGWSlhXkYGBgYhnoLUotzMEl T5V4ziHIxKwrz1IAt5MvNK4Pa9AjqFCegUm0l/woFOKUlESEk1MCrP9fJPvaB12Xfpy45NLZ2 HFx3a0FJ9JqI8si+P+bGk0PbSuaJu62d06X/S3vprxf6fD9+5C3f8bbbympjmc+qKoJ6qVFmF vS6Xc49B5oxoVeEQ2407bpR/KXL9ucHpjb7nN1nmmU0p2eu4vz7aFnCzfo16acFmHfFY92azK c/lwh9llP+zU2Ipzkg01GIuKk4EAJKWBz+iAgAA X-Env-Sender: tamas.lengyel@zentific.com X-Msg-Ref: server-15.tower-206.messagelabs.com!1476403271!51024222!1 X-Originating-IP: [209.85.192.193] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.84; banners=-,-,- X-VirusChecked: Checked Received: (qmail 41500 invoked from network); 14 Oct 2016 00:01:12 -0000 Received: from mail-pf0-f193.google.com (HELO mail-pf0-f193.google.com) (209.85.192.193) by server-15.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 14 Oct 2016 00:01:12 -0000 Received: by mail-pf0-f193.google.com with SMTP id r16so5984157pfg.3 for ; Thu, 13 Oct 2016 17:01:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zentific-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=gknCRm9tbBWwQYa9jcb8jIezLDDh8ef3R1qy6i46G7g=; b=FS1FGDQxOBA+7P2uzsLoN5VsVMeVovdTEAnXx9gPogLTKQm3GsAFsS8KUjXqMElvFP W8tvdG3QBkVSgeRTEAr20V17WVYkAPNbNFN9PxK4SPtWWybTjw6Rl8eC1WXU9EvMut9m cDm3wevi0O040rdiOaVHK7qtw65DZE6FECYRpKNg8WKLEj/qy0YrTp64BuPXg8tMGH4o hbbcgHMCpu1c+DDUpQA36g6nkGS6L6QtpfFx1UGpNUaUTZh6PqIgwBv40/XYZB3qS7ZK Tw/klK6gHLMh28JbdAKmjK9fhmGbf9KFcefm0Sw1DVd4L8ilEfy32GFoRFiAOEtZGSta Q0yA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=gknCRm9tbBWwQYa9jcb8jIezLDDh8ef3R1qy6i46G7g=; b=lQR8BdPQQt18cp4eZWm2w+0AB20v7H27HvpKnm1ToppVi33iuHxcOl7cDdZzrGR9U9 zuXADIeytoVJoTTSGwzfQl0/LbcS1I+XvpGy6/NApf2Sk/wdDwsKKMlwxqMbLyWpseZz o5frQZvBY6LMl2Nh+8LAFh61PY8BY698yYLiP35K4TfH4TA39OdZUXiQ8lATqQaEOpkn 3LNUqYTxRYMaPNtl61GAFoRUYDcJDgTPOt5oYpiINcUKubSKGqoKcdlmhPgEuq7n5y3N 9kAtGI52SS0cH70Q0OwCBLRq8dIiqwxEKD4UkSAjpF9kxKPfAERikDc2VYkFCQmZgUm3 OWlw== X-Gm-Message-State: AA6/9RlFP/Uoch7SugNnDHqTOEitrDT5uPuv/dkCFWKn3OlQ740Vdj2GCm0OXvNGtjnuZg== X-Received: by 10.98.21.138 with SMTP id 132mr13724393pfv.38.1476403271049; Thu, 13 Oct 2016 17:01:11 -0700 (PDT) Received: from l1.lan (c-73-14-35-59.hsd1.co.comcast.net. [73.14.35.59]) by smtp.gmail.com with ESMTPSA id s25sm22145967pfj.93.2016.10.13.17.01.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Oct 2016 17:01:09 -0700 (PDT) From: Tamas K Lengyel To: xen-devel@lists.xenproject.org Date: Thu, 13 Oct 2016 18:00:47 -0600 Message-Id: <20161014000047.18762-1-tamas.lengyel@zentific.com> X-Mailer: git-send-email 2.9.3 Cc: George Dunlap , Tamas K Lengyel , Jan Beulich , Andrew Cooper Subject: [Xen-devel] [PATCH for-4.8] altp2m: don't attempt to unshare pages during change_altp2m_gfn op 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 Attempting to change gfn mappings with altp2m on a memory shared page results in a lock-order violation (mm locking order violation: 282 > 254), which crashes the hypervisor. Don't attempt to automatically unshare such pages and just fall back to failing the op if the page type is not correct. Signed-off-by: Tamas K Lengyel Reviewed-by: George Dunlap --- Cc: George Dunlap Cc: Jan Beulich Cc: Andrew Cooper --- xen/arch/x86/mm/p2m.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c index 9526fff..6a45185 100644 --- a/xen/arch/x86/mm/p2m.c +++ b/xen/arch/x86/mm/p2m.c @@ -2628,7 +2628,7 @@ int p2m_change_altp2m_gfn(struct domain *d, unsigned int idx, if ( !mfn_valid(mfn) ) { mfn = __get_gfn_type_access(hp2m, gfn_x(old_gfn), &t, &a, - P2M_ALLOC | P2M_UNSHARE, &page_order, 0); + P2M_ALLOC, &page_order, 0); if ( !mfn_valid(mfn) || t != p2m_ram_rw ) goto out;