From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH v3 1/3] libxl/cpumap: Add xc_cpumap_[setcpu, clearcpu, testcpu] to complement xc_cpumap_alloc. Date: Wed, 25 Mar 2015 08:53:01 +0000 Message-ID: <1427273580.2560.232.camel@citrix.com> References: <1427211559-15185-1-git-send-email-konrad.wilk@oracle.com> <1427211559-15185-2-git-send-email-konrad.wilk@oracle.com> <1427219164.10784.7.camel@citrix.com> <20150324202916.GA1096@l.oracle.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4947141823440163821==" Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Yah3f-0001gg-UK for xen-devel@lists.xenproject.org; Wed, 25 Mar 2015 08:53:04 +0000 In-Reply-To: <20150324202916.GA1096@l.oracle.com> Content-Language: en-US List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: "konrad.wilk@oracle.com" Cc: Ian Jackson , "xen-devel@lists.xenproject.org" , Wei Liu , George Dunlap , Ian Campbell List-Id: xen-devel@lists.xenproject.org --===============4947141823440163821== Content-Language: en-US Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-PfEsFw6xQ30cJ46AHcfU" --=-PfEsFw6xQ30cJ46AHcfU Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, 2015-03-24 at 16:29 -0400, Konrad Rzeszutek Wilk wrote: > On Tue, Mar 24, 2015 at 05:46:04PM +0000, Ian Campbell wrote: > > Is it necessary to worry about alignment here, since xc_cpumap_t is > > actually a uint8_t*. > > We can also do and not worry about it: > > diff --git a/tools/libxc/xc_misc.c b/tools/libxc/xc_misc.c > index 7514b84..19a1b18 100644 > --- a/tools/libxc/xc_misc.c > +++ b/tools/libxc/xc_misc.c > @@ -94,19 +94,22 @@ xc_cpumap_t xc_cpumap_alloc(xc_interface *xch) > return calloc(1, sz); > } > =20 > +#define BITS_PER_CPUMAP(map) (sizeof(*map) * 8) > +#define CPUMAP_ENTRY(cpu, map) ((map))[(cpu) / BITS_PER_CPUMAP(map)] > +#define CPUMAP_SHIFT(cpu, map) ((cpu) % BITS_PER_CPUMAP(map)) > > [...] > Maybe it's only me, but I really find it a bit hard to figure out what the differences between this and what's in xc_bitops.h are. If going for this, I'd say that the reasons why we need these, and such differences between these and BITMAP_* should be made evident somehow (changelog, comments, etc.). Regards, Dario --=-PfEsFw6xQ30cJ46AHcfU Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEABECAAYFAlUSd2wACgkQk4XaBE3IOsT/YQCggahG/qvqAOz3ZGmfjJa2YJcx zcIAn1G57VitMuysUtOrz4MH/wpcPssf =YCt8 -----END PGP SIGNATURE----- --=-PfEsFw6xQ30cJ46AHcfU-- --===============4947141823440163821== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============4947141823440163821==--