]> xenbits.xensource.com Git - xen.git/commitdiff
x86/mm/shadow: spurious warning when unmapping xenheap pages.
authorTim Deegan <tim@xen.org>
Thu, 28 Mar 2013 10:32:17 +0000 (10:32 +0000)
committerTim Deegan <tim@xen.org>
Thu, 4 Apr 2013 09:14:30 +0000 (10:14 +0100)
Xenheap pages will always have an extra typecount, taken in
share_xen_page_with_guest(), which doesn't come from a shadow PTE.
Adjust the warning in sh_remove_all_mappings() to account for it.

Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Tim Deegan <tim@xen.org>
Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/mm/shadow/common.c

index 4b576ac0630aca75abb74ef0e460f433a641b083..adffa06c911e7b7ae991505501ba08079322a381 100644 (file)
@@ -2437,10 +2437,13 @@ int sh_remove_all_mappings(struct vcpu *v, mfn_t gmfn)
     {
         /* Don't complain if we're in HVM and there are some extra mappings: 
          * The qemu helper process has an untyped mapping of this dom's RAM 
-         * and the HVM restore program takes another. */
+         * and the HVM restore program takes another.
+         * Also allow one typed refcount for xenheap pages, to match
+         * share_xen_page_with_guest(). */
         if ( !(shadow_mode_external(v->domain)
                && (page->count_info & PGC_count_mask) <= 3
-               && (page->u.inuse.type_info & PGT_count_mask) == 0) )
+               && ((page->u.inuse.type_info & PGT_count_mask)
+                   == !!is_xen_heap_page(page))) )
         {
             SHADOW_ERROR("can't find all mappings of mfn %lx: "
                           "c=%08lx t=%08lx\n", mfn_x(gmfn),