This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


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

To: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] free the right 1st level page table page in map_pages_to_xen
From: Muli Ben-Yehuda <muli@xxxxxxxxxx>
Date: Wed, 31 May 2006 12:14:53 -0400
Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 31 May 2006 09:15:47 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.11
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) )
+                /* 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

<Prev in Thread] Current Thread [Next in Thread>