WARNING - OLD ARCHIVES

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/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] xen: handle highmem pages correctly when shrinking a

To: linux-kernel@xxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] xen: handle highmem pages correctly when shrinking a domain
From: Ian Campbell <ian.campbell@xxxxxxxxxx>
Date: Fri, 23 Jan 2009 16:26:21 +0000
Cc: Jeremy Fitzhardinge <jeremy@xxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, "dan.magenheimer@xxxxxxxxxx" <dan.magenheimer@xxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxx>, Stable Kernel <stable@xxxxxxxxxx>
Delivery-date: Fri, 23 Jan 2009 08:26:53 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
This commit causes a crash if the page being released is a highmem
page.

  commit 1058a75f07b9bb8323fb5197be5526220f8b75cf
  Author: Dan Magenheimer <dan.magenheimer@xxxxxxxxxx>
  Date:   Thu Jan 22 14:36:08 2009 -0800

    xen: actually release memory when shrinking domain

If a page is highmem then there is no need to unmap it.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Cc: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxx>
Cc: dan.magenheimer@xxxxxxxxxx <dan.magenheimer@xxxxxxxxxx>
Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Cc: Stable Kernel <stable@xxxxxxxxxx>
---
 drivers/xen/balloon.c |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff -r 7f26a03c3e02 -r 70c0102ea4c1 drivers/xen/balloon.c
--- a/drivers/xen/balloon.c     Fri Jan 23 14:14:59 2009 +0000
+++ b/drivers/xen/balloon.c     Fri Jan 23 16:24:09 2009 +0000
@@ -292,10 +292,13 @@
 
                scrub_page(page);
 
-               ret = HYPERVISOR_update_va_mapping(
-                       (unsigned long)__va(pfn << PAGE_SHIFT),
-                       __pte_ma(0), 0);
-               BUG_ON(ret);
+               if (!PageHighMem(page)) {
+                       ret = HYPERVISOR_update_va_mapping(
+                               (unsigned long)__va(pfn << PAGE_SHIFT),
+                               __pte_ma(0), 0);
+                       BUG_ON(ret);
+                }
+
        }
 
        /* Ensure that ballooned highmem pages don't have kmaps. */

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

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