# HG changeset patch # User yamahata@xxxxxxxxxxxxx # Node ID be2fdd72c5ad7e527de4e1a3ba7fdf306632e106 # Parent 5d76b22f80e408294b59c51e3f0f3bf61cb36268 Fix of C/S 10529:4260eb8c08740de0000081c61a6237ffcb95b2d5 for IA64. When page is zapped from a domain, the page referenced counter is checked. But it results in false positive alert on Xen/IA64 because a page 'in use' has reference count 2 on Xen/IA64. - a page is assigned to guest domain's psudo physical address space. This is decremented by guest_physmap_remove_page() - a page is allocated for a domain. This is decremented by the following put_page() PATCHNAME: ia64_fix_cs_10529 Signed-off-by: Isaku Yamahata diff -r 5d76b22f80e4 -r be2fdd72c5ad xen/common/memory.c --- a/xen/common/memory.c Wed Jul 26 21:13:24 2006 +0100 +++ b/xen/common/memory.c Thu Jul 27 16:08:30 2006 +0900 @@ -170,7 +170,7 @@ guest_remove_page( if ( test_and_clear_bit(_PGC_allocated, &page->count_info) ) put_page(page); - if ( unlikely((page->count_info & PGC_count_mask) != 1) ) + if ( unlikely(!page_is_removable(page)) ) { /* We'll make this a guest-visible error in future, so take heed! */ DPRINTK("Dom%d freeing in-use page %lx (pseudophys %lx):" diff -r 5d76b22f80e4 -r be2fdd72c5ad xen/include/asm-ia64/mm.h --- a/xen/include/asm-ia64/mm.h Wed Jul 26 21:13:24 2006 +0100 +++ b/xen/include/asm-ia64/mm.h Thu Jul 27 16:08:30 2006 +0900 @@ -211,6 +211,11 @@ static inline int get_page_and_type(stru } return rc; +} + +static inline int page_is_removable(struct page_info *page) +{ + return ((page->count_info & PGC_count_mask) == 2); } #define set_machinetophys(_mfn, _pfn) do { } while(0); diff -r 5d76b22f80e4 -r be2fdd72c5ad xen/include/asm-x86/mm.h --- a/xen/include/asm-x86/mm.h Wed Jul 26 21:13:24 2006 +0100 +++ b/xen/include/asm-x86/mm.h Thu Jul 27 16:08:30 2006 +0900 @@ -241,6 +241,11 @@ static inline int get_page_and_type(stru return rc; } +static inline int page_is_removable(struct page_info *page) +{ + return ((page->count_info & PGC_count_mask) == 1); +} + #define ASSERT_PAGE_IS_TYPE(_p, _t) \ ASSERT(((_p)->u.inuse.type_info & PGT_type_mask) == (_t)); \ ASSERT(((_p)->u.inuse.type_info & PGT_count_mask) != 0)