Page table pages cannot come from the Xen heap, so there''s no need to special-case these during cleanup. Signed-off-by: Jan Beulich <jbeulich@novell.com> Index: 2008-06-12/xen/arch/x86/domain.c ==================================================================--- 2008-06-12.orig/xen/arch/x86/domain.c 2008-06-12 08:57:24.000000000 +0200 +++ 2008-06-12/xen/arch/x86/domain.c 2008-06-12 09:02:00.000000000 +0200 @@ -1876,47 +1876,36 @@ int domain_relinquish_resources(struct d unmap_vcpu_info(v); } - d->arch.relmem = RELMEM_xen_l4; + d->arch.relmem = RELMEM_xen; /* fallthrough */ /* Relinquish every page of memory. */ - case RELMEM_xen_l4: -#if CONFIG_PAGING_LEVELS >= 4 - ret = relinquish_memory(d, &d->xenpage_list, PGT_l4_page_table); + case RELMEM_xen: + ret = relinquish_memory(d, &d->xenpage_list, ~0UL); if ( ret ) return ret; - d->arch.relmem = RELMEM_dom_l4; +#if CONFIG_PAGING_LEVELS >= 4 + d->arch.relmem = RELMEM_l4; /* fallthrough */ - case RELMEM_dom_l4: + + case RELMEM_l4: ret = relinquish_memory(d, &d->page_list, PGT_l4_page_table); if ( ret ) return ret; - d->arch.relmem = RELMEM_xen_l3; - /* fallthrough */ #endif - - case RELMEM_xen_l3: #if CONFIG_PAGING_LEVELS >= 3 - ret = relinquish_memory(d, &d->xenpage_list, PGT_l3_page_table); - if ( ret ) - return ret; - d->arch.relmem = RELMEM_dom_l3; + d->arch.relmem = RELMEM_l3; /* fallthrough */ - case RELMEM_dom_l3: + + case RELMEM_l3: ret = relinquish_memory(d, &d->page_list, PGT_l3_page_table); if ( ret ) return ret; - d->arch.relmem = RELMEM_xen_l2; - /* fallthrough */ #endif - - case RELMEM_xen_l2: - ret = relinquish_memory(d, &d->xenpage_list, PGT_l2_page_table); - if ( ret ) - return ret; - d->arch.relmem = RELMEM_dom_l2; + d->arch.relmem = RELMEM_l2; /* fallthrough */ - case RELMEM_dom_l2: + + case RELMEM_l2: ret = relinquish_memory(d, &d->page_list, PGT_l2_page_table); if ( ret ) return ret; @@ -1929,6 +1918,7 @@ int domain_relinquish_resources(struct d if ( ret ) return ret; #endif + WARN_ON(d->xenheap_pages); break; default: Index: 2008-06-12/xen/arch/x86/mm.c ==================================================================--- 2008-06-12.orig/xen/arch/x86/mm.c 2008-06-12 08:57:24.000000000 +0200 +++ 2008-06-12/xen/arch/x86/mm.c 2008-06-12 09:04:50.000000000 +0200 @@ -1321,7 +1321,7 @@ static void free_l3_table(struct page_in int i; #ifdef DOMAIN_DESTRUCT_AVOID_RECURSION - if ( d->arch.relmem == RELMEM_dom_l3 ) + if ( d->arch.relmem == RELMEM_l3 ) return; #endif @@ -1349,7 +1349,7 @@ static void free_l4_table(struct page_in int i; #ifdef DOMAIN_DESTRUCT_AVOID_RECURSION - if ( d->arch.relmem == RELMEM_dom_l4 ) + if ( d->arch.relmem == RELMEM_l4 ) return; #endif Index: 2008-06-12/xen/include/asm-x86/domain.h ==================================================================--- 2008-06-12.orig/xen/include/asm-x86/domain.h 2008-06-12 08:57:24.000000000 +0200 +++ 2008-06-12/xen/include/asm-x86/domain.h 2008-06-12 09:00:32.000000000 +0200 @@ -242,12 +242,10 @@ struct arch_domain /* Continuable domain_relinquish_resources(). */ enum { RELMEM_not_started, - RELMEM_xen_l4, - RELMEM_dom_l4, - RELMEM_xen_l3, - RELMEM_dom_l3, - RELMEM_xen_l2, - RELMEM_dom_l2, + RELMEM_xen, + RELMEM_l4, + RELMEM_l3, + RELMEM_l2, RELMEM_done, } relmem; struct list_head relmem_list; _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel