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] libxenctrl: Fix lock_pages()/unlock_pages

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] libxenctrl: Fix lock_pages()/unlock_pages() region-size calculation.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 01 Oct 2007 14:00:09 -0700
Delivery-date: Mon, 01 Oct 2007 14:00:32 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/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@xxxxxxxxxxxxx>
# Date 1191241099 -3600
# Node ID 69a74ac976cbc900ec0b26ba99d1e621ffa46953
# Parent  b3814860d170b29daa8ee79eec3a6de603c68b9d
libxenctrl: Fix lock_pages()/unlock_pages() region-size calculation.
Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
---
 tools/libxc/xc_private.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff -r b3814860d170 -r 69a74ac976cb tools/libxc/xc_private.c
--- a/tools/libxc/xc_private.c  Mon Oct 01 09:32:25 2007 +0100
+++ b/tools/libxc/xc_private.c  Mon Oct 01 13:18:19 2007 +0100
@@ -130,7 +130,8 @@ int lock_pages(void *addr, size_t len)
       int e = 0;
 #ifndef __sun__
       void *laddr = (void *)((unsigned long)addr & PAGE_MASK);
-      size_t llen = (len + PAGE_SIZE - 1) & PAGE_MASK;
+      size_t llen = (len + ((unsigned long)addr - (unsigned long)laddr) +
+                     PAGE_SIZE - 1) & PAGE_MASK;
       e = mlock(laddr, llen);
 #endif
       return e;
@@ -140,7 +141,8 @@ void unlock_pages(void *addr, size_t len
 {
 #ifndef __sun__
     void *laddr = (void *)((unsigned long)addr & PAGE_MASK);
-    size_t llen = (len + PAGE_SIZE - 1) & PAGE_MASK;
+    size_t llen = (len + ((unsigned long)addr - (unsigned long)laddr) +
+                   PAGE_SIZE - 1) & PAGE_MASK;
     safe_munlock(laddr, llen);
 #endif
 }

_______________________________________________
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] libxenctrl: Fix lock_pages()/unlock_pages() region-size calculation., Xen patchbot-unstable <=