From: Ian Campbell Subject: Re: [PATCH 5 of 6] [OCAML] Fix 2 bit-twiddling bugs and an off-by-one Date: Fri, 7 Oct 2011 11:59:14 +0100 Message-ID: <1317985154.21903.322.camel@zakaz.uk.xensource.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jon Ludlam Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On Fri, 2011-10-07 at 11:26 +0100, Jon Ludlam wrote: > 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 > Acked-by: Jon Ludlam Acked-by: Ian Campbell > > diff -r da67f075e413 -r fdca6d8c0c5a tools/ocaml/libs/xc/xenctrl_stubs.c > --- a/tools/ocaml/libs/xc/xenctrl_stubs.c > +++ b/tools/ocaml/libs/xc/xenctrl_stubs.c > @@ -430,7 +430,7 @@ > > for (i=0; 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 - 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-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel