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-changelog

[Xen-changelog] [xen-unstable] HAP 1GB: Add corner case handling for 1GB

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] HAP 1GB: Add corner case handling for 1GB super page.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 22 Apr 2010 17:30:20 -0700
Delivery-date: Thu, 22 Apr 2010 17:31:16 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1271925696 -3600
# Node ID 11d20f17f82c1c6fc6c003c363835a964338b311
# Parent  a4489cf8de22418a9ad4376d5fc09a75559efd7b
HAP 1GB: Add corner case handling for 1GB super page.

 - Without the check, guest memory allocation will never reach the
   boundary of a 1GB super page.

Signed-off-by: Dongxiao Xu <dongxiao.xu@xxxxxxxxx>
---
 tools/libxc/xc_hvm_build.c |    8 ++++++++
 1 files changed, 8 insertions(+)

diff -r a4489cf8de22 -r 11d20f17f82c tools/libxc/xc_hvm_build.c
--- a/tools/libxc/xc_hvm_build.c        Thu Apr 22 09:39:58 2010 +0100
+++ b/tools/libxc/xc_hvm_build.c        Thu Apr 22 09:41:36 2010 +0100
@@ -203,6 +203,14 @@ static int setup_guest(int xc_handle,
         if ( count > max_pages )
             count = max_pages;
         
+        /* Take care the corner cases of super page tails */
+        if ( ((cur_pages & (SUPERPAGE_1GB_NR_PFNS-1)) != 0) &&
+             (count > (-cur_pages & (SUPERPAGE_1GB_NR_PFNS-1))) )
+            count = -cur_pages & (SUPERPAGE_1GB_NR_PFNS-1);
+        else if ( ((count & (SUPERPAGE_1GB_NR_PFNS-1)) != 0) &&
+                  (count > SUPERPAGE_1GB_NR_PFNS) )
+            count &= ~(SUPERPAGE_1GB_NR_PFNS - 1);
+
         /* Attemp to allocate 1GB super page. Because in each pass we only
          * allocate at most 1GB, we don't have to clip super page boundaries.
          */

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] HAP 1GB: Add corner case handling for 1GB super page., Xen patchbot-unstable <=