From patchwork Wed Jan 25 16:12:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tamas Lengyel X-Patchwork-Id: 9537409 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 1DDEE6042C for ; Wed, 25 Jan 2017 16:14:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0ECF427D8D for ; Wed, 25 Jan 2017 16:14:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 036FA27E33; Wed, 25 Jan 2017 16:14:25 +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 9521427D8D for ; Wed, 25 Jan 2017 16:14:24 +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 1cWQBC-0000EY-Sw; Wed, 25 Jan 2017 16:12:14 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cWQBB-0000EN-Lz for xen-devel@lists.xenproject.org; Wed, 25 Jan 2017 16:12:13 +0000 Received: from [85.158.139.211] by server-11.bemta-5.messagelabs.com id E5/F9-14064-C5EC8885; Wed, 25 Jan 2017 16:12:12 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupnkeJIrShJLcpLzFFi42K5GHrgiG7MuY4 Ig9U/eCy+b5nM5MDocfjDFZYAxijWzLyk/IoE1ozf53YzFvzhqvj35iNjA+M3ji5GLg4hgVmM Ev9/P2YBcVgE3rBIzP3/ibmLkZNDQuAdi8TTuw4QdozEq5etTBB2pcSs40tZQWwhAU2JgxvOM ENMmsAk8fkaRDObgJHE1as9bCC2iICSxL1Vk5lAipgFWhgl9n+4yA6SEBaIlHjedgqsgUVAVW LrvT1gU3kF7CVa9/5kgdgmL7Gr7SLrBEa+BYwMqxg1ilOLylKLdI2M9ZKKMtMzSnITM3N0DQ1 M9XJTi4sT01NzEpOK9ZLzczcxAoOlnoGBcQfjjna/Q4ySHExKorynTnVECPEl5adUZiQWZ8QX leakFh9ilOHgUJLgFT8LlBMsSk1PrUjLzAGGLUxagoNHSYRXGCTNW1yQmFucmQ6ROsVozNHTd folE8eeXZdfMgmx5OXnpUqJ84aAlAqAlGaU5sENgsXTJUZZKWFeRgYGBiGegtSi3MwSVPlXjO IcjErCvMYgU3gy80rg9r0COoUJ6JQLzO0gp5QkIqSkGhjnTJmcorf82cYoPs/M4PANNoeKjCI 6zjgr8AnV8ER0KAlP4RJump3fXvvVrqr1fXGofl/upA05bCHt93+/yG1YbdB1J61yYu4lfr4s Zd3ugJyPqxilHPNVhOMYV5fbFjc02f+53C7u2VZu3cpRfntiSe23ebpf5rPMEG86f/90v9MrY 4OPSizFGYmGWsxFxYkAuCaUnKICAAA= X-Env-Sender: tamas.lengyel@zentific.com X-Msg-Ref: server-14.tower-206.messagelabs.com!1485360730!42897345!1 X-Originating-IP: [209.85.192.196] 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 2096 invoked from network); 25 Jan 2017 16:12:12 -0000 Received: from mail-pf0-f196.google.com (HELO mail-pf0-f196.google.com) (209.85.192.196) by server-14.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 25 Jan 2017 16:12:12 -0000 Received: by mail-pf0-f196.google.com with SMTP id y143so14681665pfb.1 for ; Wed, 25 Jan 2017 08:12:11 -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=X1jwdUqHHmypS06OU4Bfywlv4j69LUWgRODTSSAfsgs=; b=GEZxxKgTdYOZF/5bCcQ3XCAmk4G2ljgHdZyk8Tb5re7OhwKE6ixuf1MXKekctBNuSH OFd84dhpdpI7vXfd0Vf+xEenfaZMQ5thaIr7le71x0oBeEGbi7rwjaR95CDuN3l5VfwT ef/cRgZSdUw/0Qz9gJ90FGVVoLtfT9NwRq+BkDACt3r9kqbC3xQB19kZZayTuhGvPGw6 Teoh1ntfr8itKLeOxISVDf/aMJ8wKqBh8UUr7WDRb0EebWTV4FuTqrvyEO2R29ZG7lNm DCuNPFl/iWkJcYGTizjf0wAKZBZowJ4Lt1Qmj9iVilcF1vDiXFuy2qZL9e2Ny7dUC4AL oIVA== 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=X1jwdUqHHmypS06OU4Bfywlv4j69LUWgRODTSSAfsgs=; b=Z5yDBaCkDPYjkq7zPFMCfQuilnSdpXqZeqChr0hAeDDsARHKUl+nIuUU0Tnqj33yoi yaLWEziwHH9ckXAFpMDE4Rk3SD4vdP9LyglGXAz8yIXmeAClp7aFjB1ifDq2bAsWothx LQn5axqMz4hWvkDr804cJju3O1PIG4ua88OMQrASDnB1APDKb2VM66jhRnZXbuXttgud ShtUybBZgJjVfS7HrOw+3RlaL/vl+DMrAgNJDwubTkasM13B/GtIM9vSE554o/wLkD3H FS2AaF1E+nl2YTbCmTBt2T5hph2Zf0i3GokYmR3xAjNOgWvxXdqloLlYPfsR9HFNR72G A/sQ== X-Gm-Message-State: AIkVDXJNmmNzRkxXlXTKU8faj1YoWtKOcOe+ua1MBuYMScaZo4bTEdip/5dkebWKqiXyNQ== X-Received: by 10.99.210.81 with SMTP id t17mr47699652pgi.95.1485360730405; Wed, 25 Jan 2017 08:12:10 -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 82sm2231278pge.42.2017.01.25.08.12.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Jan 2017 08:12:09 -0800 (PST) From: Tamas K Lengyel To: xen-devel@lists.xenproject.org Date: Wed, 25 Jan 2017 09:12:01 -0700 Message-Id: <20170125161201.20062-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 v3] 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 Acked-by: Julien Grall --- Cc: Stefano Stabellini Cc: Julien Grall v3: Minor adjustments --- xen/arch/arm/p2m.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c index 09ceb378a5..7762f453f5 100644 --- a/xen/arch/arm/p2m.c +++ b/xen/arch/arm/p2m.c @@ -991,9 +991,10 @@ 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. + * memaccess is enabled and during shutdown. */ - ASSERT(!p2m->mem_access_enabled || page_order == 0); + ASSERT(!p2m->mem_access_enabled || page_order == 0 || + p2m->domain->is_dying); /* * The access type should always be p2m_access_rwx when the mapping * is removed.