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] [LIBXC] Handle trace-buffer cpumap endian

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [LIBXC] Handle trace-buffer cpumap endianness.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 19 Jan 2007 10:45:13 -0800
Delivery-date: Fri, 19 Jan 2007 10:45:55 -0800
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 kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1169217677 0
# Node ID 1a45828882e9b49e4c5927541ea336ecd24c041b
# Parent  cd532c9351fc746ac368bbd07180cfffc95ad9f0
[LIBXC] Handle trace-buffer cpumap endianness.
Original patch from Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 tools/libxc/xc_tbuf.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff -r cd532c9351fc -r 1a45828882e9 tools/libxc/xc_tbuf.c
--- a/tools/libxc/xc_tbuf.c     Fri Jan 19 14:36:12 2007 +0000
+++ b/tools/libxc/xc_tbuf.c     Fri Jan 19 14:41:17 2007 +0000
@@ -96,15 +96,19 @@ int xc_tbuf_set_cpu_mask(int xc_handle, 
 {
     DECLARE_SYSCTL;
     int ret = -1;
+    uint64_t mask64 = mask;
+    uint8_t bytemap[sizeof(mask64)];
 
     sysctl.cmd = XEN_SYSCTL_tbuf_op;
     sysctl.interface_version = XEN_SYSCTL_INTERFACE_VERSION;
     sysctl.u.tbuf_op.cmd  = XEN_SYSCTL_TBUFOP_set_cpu_mask;
 
-    set_xen_guest_handle(sysctl.u.tbuf_op.cpu_mask.bitmap, (uint8_t *)&mask);
-    sysctl.u.tbuf_op.cpu_mask.nr_cpus = sizeof(mask) * 8;
+    bitmap_64_to_byte(bytemap, &mask64, sizeof (mask64));
 
-    if ( lock_pages(&mask, sizeof(mask)) != 0 )
+    set_xen_guest_handle(sysctl.u.tbuf_op.cpu_mask.bitmap, bytemap);
+    sysctl.u.tbuf_op.cpu_mask.nr_cpus = sizeof(bytemap) * 8;
+
+    if ( lock_pages(&bytemap, sizeof(bytemap)) != 0 )
     {
         PERROR("Could not lock memory for Xen hypercall");
         goto out;
@@ -112,7 +116,7 @@ int xc_tbuf_set_cpu_mask(int xc_handle, 
 
     ret = do_sysctl(xc_handle, &sysctl);
 
-    unlock_pages(&mask, sizeof(mask));
+    unlock_pages(&bytemap, sizeof(bytemap));
 
  out:
     return ret;

_______________________________________________
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] [LIBXC] Handle trace-buffer cpumap endianness., Xen patchbot-unstable <=