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

[Xen-changelog] [xen master] tools/libxc: linux: Don't use getpagesize() when unmapping the grants



commit 31cf2ca7518188ec154d1d82c38970883183fa3b
Author:     Julien Grall <julien.grall@xxxxxxxxxx>
AuthorDate: Fri Aug 7 19:53:55 2015 +0100
Commit:     Ian Campbell <ian.campbell@xxxxxxxxxx>
CommitDate: Thu Aug 13 10:25:11 2015 +0100

    tools/libxc: linux: Don't use getpagesize() when unmapping the grants
    
    The grants are based on the Xen granularity (i.e 4KB). While the function
    to map grants for Linux (linux_gnttab_grant_map) is using the correct
    size (XC_PAGE_SIZE), the unmap one (linux_gnttab_munmap) is using
    getpagesize().
    
    On domain using a page granularity different than Xen (this is the case
    for AARCH64 guest using 64KB page), the unmap will be called with the
    wrong size.
    
    Signed-off-by: Julien Grall <julien.grall@xxxxxxxxxx>
    Acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>
    Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
 tools/libxc/xc_linux_osdep.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxc/xc_linux_osdep.c b/tools/libxc/xc_linux_osdep.c
index e375428..76c55ff 100644
--- a/tools/libxc/xc_linux_osdep.c
+++ b/tools/libxc/xc_linux_osdep.c
@@ -742,7 +742,7 @@ static int linux_gnttab_munmap(xc_gnttab *xcg, 
xc_osdep_handle h,
     }
 
     /* Next, unmap the memory. */
-    if ( (rc = munmap(start_address, count * getpagesize())) )
+    if ( (rc = munmap(start_address, count * XC_PAGE_SIZE)) )
         return rc;
 
     /* Finally, unmap the driver slots used to store the grant information. */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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


 


Rackspace

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