[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] [IA64] Fix of C/S 10529:4260eb8c08740de0000081c61a6237ffcb95b2d5 for IA64.



# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Node ID 5fa2cd68d059dd32d6c23f196ec6eae3c1690ad6
# Parent  f42039dcdc814cf3d154cdccd58f930df98901dd
[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@xxxxxxxxxxxxx>
---
 xen/common/memory.c       |    2 +-
 xen/include/asm-ia64/mm.h |    5 +++++
 xen/include/asm-x86/mm.h  |    5 +++++
 3 files changed, 11 insertions(+), 1 deletion(-)

diff -r f42039dcdc81 -r 5fa2cd68d059 xen/common/memory.c
--- a/xen/common/memory.c       Thu Jul 27 13:05:33 2006 +0100
+++ b/xen/common/memory.c       Thu Jul 27 13:17:17 2006 +0100
@@ -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 f42039dcdc81 -r 5fa2cd68d059 xen/include/asm-ia64/mm.h
--- a/xen/include/asm-ia64/mm.h Thu Jul 27 13:05:33 2006 +0100
+++ b/xen/include/asm-ia64/mm.h Thu Jul 27 13:17:17 2006 +0100
@@ -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 f42039dcdc81 -r 5fa2cd68d059 xen/include/asm-x86/mm.h
--- a/xen/include/asm-x86/mm.h  Thu Jul 27 13:05:33 2006 +0100
+++ b/xen/include/asm-x86/mm.h  Thu Jul 27 13:17:17 2006 +0100
@@ -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)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.