diff options
author | Tim Deegan <tim@xen.org> | 2013-04-09 16:19:53 +0200 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2013-04-09 16:19:53 +0200 |
commit | e6bd18f4cf30c3e26b44e52a929d18066e0c8ceb (patch) | |
tree | d233c8cddd995a5b32213ba7aa6df6b80b53442b | |
parent | 95483087da57c29d778cbc1941a807f60357daf7 (diff) | |
download | xen-e6bd18f4cf30c3e26b44e52a929d18066e0c8ceb.tar.gz xen-e6bd18f4cf30c3e26b44e52a929d18066e0c8ceb.tar.bz2 xen-e6bd18f4cf30c3e26b44e52a929d18066e0c8ceb.zip |
x86/mm/shadow: spurious warning when unmapping xenheap pages.
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>
master commit: cfc515dabe91e3d6c690c68c6a669d6d77fb7ac4
master date: 2013-04-04 10:14:30 +0100
-rw-r--r-- | xen/arch/x86/mm/shadow/common.c | 7 | ||||
-rw-r--r-- | xen/include/asm-x86/mm.h | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c index 5e5f9c16dc..fed3503ebe 100644 --- a/xen/arch/x86/mm/shadow/common.c +++ b/xen/arch/x86/mm/shadow/common.c @@ -2549,10 +2549,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), diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h index 2013ba9280..cedab73ca1 100644 --- a/xen/include/asm-x86/mm.h +++ b/xen/include/asm-x86/mm.h @@ -238,7 +238,7 @@ struct spage_info #endif #if defined(__i386__) -#define is_xen_heap_page(page) is_xen_heap_mfn(page_to_mfn(page)) +#define is_xen_heap_page(page) is_xen_heap_mfn(__page_to_mfn(page)) #define is_xen_heap_mfn(mfn) ({ \ unsigned long _mfn = (mfn); \ (_mfn < paddr_to_pfn(xenheap_phys_end)); \ |