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] tools/ocaml: Fix 2 bit-twiddling bugs and

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] tools/ocaml: Fix 2 bit-twiddling bugs and an off-by-one
From: Xen patchbot-unstable <patchbot@xxxxxxx>
Date: Tue, 11 Oct 2011 00:44:12 +0100
Delivery-date: Mon, 10 Oct 2011 16:44:59 -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 Jon Ludlam <jonathan.ludlam@xxxxxxxxxxxxx>
# Date 1318261276 -3600
# Node ID 187d59e32a586d65697ed46bef106b52e3fb5ab9
# Parent  51288f69523fcbbefa12cea5a761a6e957410151
tools/ocaml: Fix 2 bit-twiddling bugs and an off-by-one

The bit bugs are in ocaml vcpu affinity calls, and the off-by-one
error is in the ocaml console ring code

Signed-off-by: Zheng Li <zheng.li@xxxxxxxxxxxxx>
Acked-by: Ian Campbell <ian.campbell.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Jon Ludlam <jonathan.ludlam@xxxxxxxxxxxxx>
---


diff -r 51288f69523f -r 187d59e32a58 tools/ocaml/libs/xc/xenctrl_stubs.c
--- a/tools/ocaml/libs/xc/xenctrl_stubs.c       Mon Oct 10 16:41:16 2011 +0100
+++ b/tools/ocaml/libs/xc/xenctrl_stubs.c       Mon Oct 10 16:41:16 2011 +0100
@@ -430,7 +430,7 @@
 
        for (i=0; i<len; i++) {
                if (Bool_val(Field(cpumap, i)))
-                       c_cpumap[i/8] |= i << (i&7);
+                       c_cpumap[i/8] |= 1 << (i&7);
        }
        retval = xc_vcpu_setaffinity(_H(xch), _D(domid),
                                     Int_val(vcpu), c_cpumap);
@@ -466,7 +466,7 @@
        ret = caml_alloc(len, 0);
 
        for (i=0; i<len; i++) {
-               if (c_cpumap[i%8] & 1 << (i&7))
+               if (c_cpumap[i/8] & 1 << (i&7))
                        Store_field(ret, i, Val_true);
                else
                        Store_field(ret, i, Val_false);
@@ -523,7 +523,7 @@
 
 CAMLprim value stub_xc_readconsolering(value xch)
 {
-       unsigned int size = RING_SIZE;
+       unsigned int size = RING_SIZE - 1;
        char *ring_ptr = ring;
 
        CAMLparam1(xch);

_______________________________________________
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] tools/ocaml: Fix 2 bit-twiddling bugs and an off-by-one, Xen patchbot-unstable <=