ia64/xen-unstable

changeset 10823:5fa2cd68d059

[IA64] 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()

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author kfraser@localhost.localdomain
date Thu Jul 27 13:17:17 2006 +0100 (2006-07-27)
parents f42039dcdc81
children b42b80403ddd
files xen/common/memory.c xen/include/asm-ia64/mm.h xen/include/asm-x86/mm.h
line diff
     1.1 --- a/xen/common/memory.c	Thu Jul 27 13:05:33 2006 +0100
     1.2 +++ b/xen/common/memory.c	Thu Jul 27 13:17:17 2006 +0100
     1.3 @@ -170,7 +170,7 @@ guest_remove_page(
     1.4      if ( test_and_clear_bit(_PGC_allocated, &page->count_info) )
     1.5          put_page(page);
     1.6  
     1.7 -    if ( unlikely((page->count_info & PGC_count_mask) != 1) )
     1.8 +    if ( unlikely(!page_is_removable(page)) )
     1.9      {
    1.10          /* We'll make this a guest-visible error in future, so take heed! */
    1.11          DPRINTK("Dom%d freeing in-use page %lx (pseudophys %lx):"
     2.1 --- a/xen/include/asm-ia64/mm.h	Thu Jul 27 13:05:33 2006 +0100
     2.2 +++ b/xen/include/asm-ia64/mm.h	Thu Jul 27 13:17:17 2006 +0100
     2.3 @@ -213,6 +213,11 @@ static inline int get_page_and_type(stru
     2.4      return rc;
     2.5  }
     2.6  
     2.7 +static inline int page_is_removable(struct page_info *page)
     2.8 +{
     2.9 +    return ((page->count_info & PGC_count_mask) == 2);
    2.10 +}
    2.11 +
    2.12  #define	set_machinetophys(_mfn, _pfn) do { } while(0);
    2.13  
    2.14  #ifdef MEMORY_GUARD
     3.1 --- a/xen/include/asm-x86/mm.h	Thu Jul 27 13:05:33 2006 +0100
     3.2 +++ b/xen/include/asm-x86/mm.h	Thu Jul 27 13:17:17 2006 +0100
     3.3 @@ -241,6 +241,11 @@ static inline int get_page_and_type(stru
     3.4      return rc;
     3.5  }
     3.6  
     3.7 +static inline int page_is_removable(struct page_info *page)
     3.8 +{
     3.9 +    return ((page->count_info & PGC_count_mask) == 1);
    3.10 +}
    3.11 +
    3.12  #define ASSERT_PAGE_IS_TYPE(_p, _t)                            \
    3.13      ASSERT(((_p)->u.inuse.type_info & PGT_type_mask) == (_t)); \
    3.14      ASSERT(((_p)->u.inuse.type_info & PGT_count_mask) != 0)