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

[Xen-changelog] Shadow code bug fix (found by Ian) that was breaking refcounts, and subsequently



ChangeSet 1.1159.258.120, 2005/05/13 12:14:06+01:00, mafetter@xxxxxxxxxxxxxxxx

        Shadow code bug fix (found by Ian) that was breaking refcounts, and 
subsequently
        causing migration problems.



 memory.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)


diff -Nru a/xen/arch/x86/memory.c b/xen/arch/x86/memory.c
--- a/xen/arch/x86/memory.c     2005-05-13 16:06:48 -04:00
+++ b/xen/arch/x86/memory.c     2005-05-13 16:06:48 -04:00
@@ -1607,13 +1607,14 @@
             unsigned l2_idx = page_nr >> (L2_PAGETABLE_SHIFT - 
L1_PAGETABLE_SHIFT);
             l2_pgentry_t gpde = linear_l2_table[l2_idx];
             unsigned long gpfn = l2_pgentry_val(gpde) >> PAGE_SHIFT;
+            unsigned long spfn;
 
-            if (get_shadow_status(&d->mm, gpfn))
+            if ((spfn = (get_shadow_status(&d->mm, gpfn) & PSH_pfn_mask)))
             {
-                unsigned long *gl1e = map_domain_mem(gpfn << PAGE_SHIFT);
+                unsigned long *sl1e = map_domain_mem(spfn << PAGE_SHIFT);
                 unsigned l1_idx = page_nr & (ENTRIES_PER_L1_PAGETABLE - 1);
-                gl1e[l1_idx] = sval;
-                unmap_domain_mem(gl1e);
+                sl1e[l1_idx] = sval;
+                unmap_domain_mem(sl1e);
                 put_shadow_status(&d->mm);
 
                 perfc_incrc(shadow_update_va_fail1);

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