From patchwork Wed Jan 25 00:16:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tamas Lengyel X-Patchwork-Id: 9536235 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 54D20601D3 for ; Wed, 25 Jan 2017 00:18:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 472E926E55 for ; Wed, 25 Jan 2017 00:18:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3B39427D85; Wed, 25 Jan 2017 00:18:26 +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=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RCVD_IN_SORBS_SPAM,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 B8CA726E55 for ; Wed, 25 Jan 2017 00:18:25 +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 1cWBG5-0002dq-Ie; Wed, 25 Jan 2017 00:16:17 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cWBG4-0002dj-Cd for xen-devel@lists.xenproject.org; Wed, 25 Jan 2017 00:16:16 +0000 Received: from [193.109.254.147] by server-6.bemta-6.messagelabs.com id EC/38-15112-F4EE7885; Wed, 25 Jan 2017 00:16:15 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmplkeJIrShJLcpLzFFi42Lxqg121vV/1x5 hMHkfk8X3LZOZHBg9Dn+4whLAGMWamZeUX5HAmvH6XEjBXa6KhsYrzA2MTzi6GLk4hAQmM0o8 OLCDHcRhEXjDItHWdJG5i5GTQ0LgHYvEpm08EHaMxPwFKxkh7CqJXz/2gtlCApoSBzecYYaw+ 5kk5p03A7HZBIwkrl7tYQOxRQSUJO6tmswEsoBZoIVRYv+Hi0DbODiEBSIlvswvAKlhEVCVmL 17AdgcXgF7ib2Na1kgdslL7Gq7yDqBkW8BI8MqRvXi1KKy1CJdC72kosz0jJLcxMwcXUMDM73 c1OLixPTUnMSkYr3k/NxNjMAgYQCCHYyzL/sfYpTkYFIS5b18sT1CiC8pP6UyI7E4I76oNCe1 +BCjDAeHkgRvzlugnGBRanpqRVpmDjBcYdISHDxKIrzMIGne4oLE3OLMdIjUKUZdjl27Lr9kE mLJy89LlRLnPfQGqEgApCijNA9uBCx2LjHKSgnzMgIdJcRTkFqUm1mCKv+KUZyDUUmYlx1kFU 9mXgncpldARzABHXGBGeyIkkSElFQDY1f8ib132D/KLMtpuHBk9e1QltTwOt0PvHEP77LPyL7 CL8V4jc2fZ+melVYcUcYT3/acNPcIEk/j6dc4euL32Uquj9NV5gQJNt/R19D+GX7tYJji1a7y sJg/n+ccnx1peUJzebc1y4MHIenmLQIxqXwc4l9idhtvm7vy4s+KkBouyxvGuYs+KLEUZyQaa jEXFScCACF40x6YAgAA X-Env-Sender: tamas.lengyel@zentific.com X-Msg-Ref: server-12.tower-27.messagelabs.com!1485303373!82096299!1 X-Originating-IP: [74.125.83.67] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.1.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 38825 invoked from network); 25 Jan 2017 00:16:14 -0000 Received: from mail-pg0-f67.google.com (HELO mail-pg0-f67.google.com) (74.125.83.67) by server-12.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 25 Jan 2017 00:16:14 -0000 Received: by mail-pg0-f67.google.com with SMTP id 3so91682pgj.1 for ; Tue, 24 Jan 2017 16:16:14 -0800 (PST) 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=4qzQhI7JB4/sgKR/4suBCuYcb+nXsqKBGXA7+P+ZGpE=; b=nSdSpv0CUlneC2IcvbAQ7BHQD0yJjRm/KlJ3hNu1ah0a5fp3elT70mkQw8o2GgukDT KPTIotcS73ieKq/4T4SXruDh6matuCmO4euw6F9Hg66aK98L3PUYH8f0akc2DTi68Ynp +if+nEaOJziC3Be3p89RSW4wBQrU6dNPHNvO3HP9bBVnFu8TFYCDNYHPLVqpUQ8y695O v09t8qIHRnlFJmxcl5Rhh8N7tC0GJnzvz5mW8FabssiPPS9y8zydaUgHBu8KWD7ujtb0 X93wovGiOVL5UNP4+lcUp2K3niuoyQphATl5VXPdvpErNGjD7KsEBrqk+DcxJX1JeHeG UUsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=4qzQhI7JB4/sgKR/4suBCuYcb+nXsqKBGXA7+P+ZGpE=; b=bMHJJ3eufsZJYXvqfWZt+pxPyKNvc3ND5RZeVCEdoD91PzvbDHKw6P7k20c48Z2PFN 0OMDANdne/7CMYjlP+8dYK8Zk0edmayQosi5eD2ZWLFH/s07at5nP6mm3aSamLMyFpbF CUbb9duSI/Lf7SyJ2QrJCvVNeFsgVr+Y7OEDJ6CS2ZXUoajoiyhP6C1D2ORxuprS9bNI 9dXNBOjjIYY4wOAx/KAlaumOv4eUJR5GvFbeDzqMGeig8k7A4VBjN8D5Vxp+BW3qMWJ6 u121WOtZYEwyUtt7qbppMQmrf4ic+xqDnyboOKRJU68dCWTG8XmdI47kWiDBFOUMNJyQ Q9AQ== X-Gm-Message-State: AIkVDXKqAJJiK8H7p4SzpOghKiIuYTb+nuTfT/98BcC5GA+oKc9KPxebQZVJwycxRq0xsA== X-Received: by 10.98.93.152 with SMTP id n24mr43029540pfj.107.1485303373292; Tue, 24 Jan 2017 16:16:13 -0800 (PST) Received: from l1.lan (c-73-14-35-59.hsd1.co.comcast.net. [73.14.35.59]) by smtp.gmail.com with ESMTPSA id y6sm8269457pgc.1.2017.01.24.16.16.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Jan 2017 16:16:12 -0800 (PST) From: Tamas K Lengyel To: xen-devel@lists.xenproject.org Date: Tue, 24 Jan 2017 17:16:02 -0700 Message-Id: <20170125001602.31195-1-tamas.lengyel@zentific.com> X-Mailer: git-send-email 2.11.0 Cc: Tamas K Lengyel , Julien Grall , Stefano Stabellini Subject: [Xen-devel] [PATCH v2] arm/p2m: Fix regression during domain shutdown with active 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 The change in commit 438c5fe4f0c introduced a regression for domains where mem_acces is or was active. When relinquish_p2m_mapping attempts to clear a page where the order is not 0 the following ASSERT is triggered: ASSERT(!p2m->mem_access_enabled || page_order == 0); This regression was unfortunately not caught during testing in preparation for the 4.8 release. In this patch we adjust the ASSERT to not trip when the domain is being shutdown. Ideally this fix would be part of Xen 4.8.1. Signed-off-by: Tamas K Lengyel --- Cc: Stefano Stabellini Cc: Julien Grall v2: Add dying domain check to assert --- xen/arch/arm/p2m.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c index 09ceb378a5..d9fdfe9a2e 100644 --- a/xen/arch/arm/p2m.c +++ b/xen/arch/arm/p2m.c @@ -993,7 +993,8 @@ static int __p2m_set_entry(struct p2m_domain *p2m, * The radix-tree can only work on 4KB. This is only used when * memaccess is enabled. */ - ASSERT(!p2m->mem_access_enabled || page_order == 0); + ASSERT(!p2m->mem_access_enabled || page_order == 0 || + p2m->domain->is_dying == DOMDYING_dying); /* * The access type should always be p2m_access_rwx when the mapping * is removed.