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

[Xen-devel] [PATCH] free the right 1st level page table page in map_pages_to_xen



Hi Keir,

I think there's a buglet in map_pages_to_xen(), although it's entirely
possible I'm mis-reading it. In the case where we end up replacing a
non-super-page 2nd level entry with a super-page entry, we should free
the page table page pointed to by the old entry, not the new entry
(which doesn't actually point to a 1st level page).

Here's an untested "obviously correct" patch.

Signed-off-by: Muli Ben-Yehuda <muli@xxxxxxxxxx>

diff -r 0d17e9d6353d xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c Wed May 31 10:22:47 2006 -0400
+++ b/xen/arch/x86/mm.c Wed May 31 12:11:46 2006 -0400
@@ -3708,8 +3708,9 @@ int map_pages_to_xen(
             if ( (l2e_get_flags(ol2e) & _PAGE_PRESENT) )
             {
                 local_flush_tlb_pge();
+                /* Free the 1st level ptpage pointed to old 2nd level entry. */
                 if ( !(l2e_get_flags(ol2e) & _PAGE_PSE) )
-                    free_xen_pagetable(l2e_get_page(*pl2e));
+                    free_xen_pagetable(l2e_get_page(ol2e));
             }
 
             virt    += 1UL << L2_PAGETABLE_SHIFT;



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


 


Rackspace

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