[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-4.1-testing] tools/ocaml: Fix 2 bit-twiddling bugs and an off-by-one
# HG changeset patch # User Zheng Li <zheng.li@xxxxxxxxxxxxx> # Date 1341319687 -3600 # Node ID 32ab8989df674433a1c26d0b4cdda9eab4a6fc07 # Parent ec75bfd8599cad22339420d6436fb74584f9c767 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> xen-unstable changeset: 23940:187d59e32a58 xen-unstable date: Mon Oct 10 16:41:16 2011 +0100 --- diff -r ec75bfd8599c -r 32ab8989df67 tools/ocaml/libs/xc/xc_stubs.c --- a/tools/ocaml/libs/xc/xc_stubs.c Wed Jun 20 09:37:29 2012 +0100 +++ b/tools/ocaml/libs/xc/xc_stubs.c Tue Jul 03 13:48:07 2012 +0100 @@ -430,7 +430,7 @@ CAMLprim value stub_xc_vcpu_setaffinity( 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 @@ CAMLprim value stub_xc_vcpu_getaffinity( 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 @@ static char ring[RING_SIZE]; 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@xxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |