]> xenbits.xensource.com Git - xen.git/commitdiff
arm/p2m: Fix regression during domain shutdown with active mem_access
authorTamas K Lengyel <tamas.lengyel@zentific.com>
Wed, 25 Jan 2017 16:12:01 +0000 (09:12 -0700)
committerStefano Stabellini <sstabellini@kernel.org>
Fri, 27 Jan 2017 01:43:50 +0000 (17:43 -0800)
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.

Signed-off-by: Tamas K Lengyel <tamas.lengyel@zentific.com>
Acked-by: Julien Grall <julien.grall@arm.com>
xen/arch/arm/p2m.c

index cc5634bd170d35bdb179d6375b4baef0c1851a0b..9e810487bbdbfc5117df3e3e4180955afeade9ec 100644 (file)
@@ -982,9 +982,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.