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

[Xen-changelog] [xen-unstable] x86: shadow_alloc_p2m_page() should call shadow_prealloc() before shadow_alloc()



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1250781352 -3600
# Node ID 4b30cfb855299922244938fde4f88f4e5bb5df34
# Parent  1cdf9f96e3c19469241aae657c498307ec840579
x86: shadow_alloc_p2m_page() should call shadow_prealloc() before shadow_alloc()

shadow_alloc_p2m_page() fails to call shadow_prealloc() before calling
shadow_alloc().  In certain conditions, notably when PoD is being
exercised, this may cause shadow_alloc() to fail, crashing Xen.

Signed-off-by: George Dunlap <george.dunlap@xxxxxxxxxxxxx>
---
 xen/arch/x86/mm/shadow/common.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -r 1cdf9f96e3c1 -r 4b30cfb85529 xen/arch/x86/mm/shadow/common.c
--- a/xen/arch/x86/mm/shadow/common.c   Thu Aug 20 13:32:31 2009 +0100
+++ b/xen/arch/x86/mm/shadow/common.c   Thu Aug 20 16:15:52 2009 +0100
@@ -1423,7 +1423,6 @@ static void _shadow_prealloc(
  * to avoid freeing shadows that the caller is currently working on. */
 void shadow_prealloc(struct domain *d, u32 type, unsigned int count)
 {
-    ASSERT(type != SH_type_p2m_table);
     return _shadow_prealloc(d, shadow_order(type), count);
 }
 
@@ -1676,6 +1675,7 @@ sh_alloc_p2m_pages(struct domain *d)
          < (shadow_min_acceptable_pages(d) + (1 << order)) )
         return 0; /* Not enough shadow memory: need to increase it first */
     
+    shadow_prealloc(d, SH_type_p2m_table, 1);
     pg = mfn_to_page(shadow_alloc(d, SH_type_p2m_table, 0));
     d->arch.paging.shadow.p2m_pages += (1 << order);
     d->arch.paging.shadow.total_pages -= (1 << order);

_______________________________________________
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®.