From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH for-xen-4.5] libxl: Allow copying smaller bitmap into a larger one Date: Tue, 25 Nov 2014 12:41:07 +0100 Message-ID: <1416915667.7176.39.camel@Abyss> References: <1416518854-5284-1-git-send-email-boris.ostrovsky@oracle.com> <20141124104127.GF30053@zion.uk.xensource.com> <20141124104703.GH30053@zion.uk.xensource.com> <54735343.1020208@oracle.com> <20141125103940.GC28315@zion.uk.xensource.com> <20141125111522.GD28315@zion.uk.xensource.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7525583402525280150==" Return-path: In-Reply-To: <20141125111522.GD28315@zion.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Wei Liu Cc: ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com, ian.jackson@eu.citrix.com, xen-devel@lists.xen.org, Boris Ostrovsky List-Id: xen-devel@lists.xenproject.org --===============7525583402525280150== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-n7p/agl5pmDgF+uvgu9F" --=-n7p/agl5pmDgF+uvgu9F Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, 2014-11-25 at 11:15 +0000, Wei Liu wrote: > And here it is. >=20 > Boris, can you give it a shot? >=20 > ---8<--- > From 77531e31d239887b9f36c03e434300bc30683092 Mon Sep 17 00:00:00 2001 > From: Wei Liu > Date: Tue, 25 Nov 2014 10:59:47 +0000 > Subject: [PATCH] libxl: allow copying between bitmaps of different sizes >=20 > When parsing bitmap objects JSON parser will create libxl_bitmap map of t= he > smallest size needed. >=20 > This can cause problems when saved image file specifies CPU affinity. Fo= r > example, if 'vcpu_hard_affinity' in the saved image has only the first CP= U > specified, just a single byte will be allocated and libxl_bitmap->size wi= ll be > set to 1. >=20 > This will result in assertion in libxl_set_vcpuaffinity()->libxl_bitmap_c= opy() > since the destination bitmap is created for maximum number of CPUs. >=20 > We could allocate that bitmap of the same size as the source, however, it= is > later passed to xc_vcpu_setaffinity() which expects it to be sized to the= max > number of CPUs >=20 > To fix this issue, introduce an internal function to allowing copying bet= ween > bitmaps of different sizes. Note that this function is only used in > libxl_set_vcpuaffinity at the moment. Though NUMA placement logic invoke > libxl_bitmap_copy as well there's no need to replace those invocations. = NUMA > placement logic comes into effect when no vcpu / node pinning is provided= , so > it always operates on bitmap of the same sizes (that is, size of maximum > number of cpus /nodes). >=20 > Reported-by: Boris Ostrovsky > Signed-off-by: Wei Liu > Cc: Ian Campbell > Cc: Ian Jackson > Cc: Dario Faggioli > If this end up being the approach, it can have the following: Reviewed-by: Dario Faggioli --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-n7p/agl5pmDgF+uvgu9F 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 iEYEABECAAYFAlR0atMACgkQk4XaBE3IOsTo1gCgrYe3N293DmpXoQL8ciM3p0N5 X6YAni1Z/c9DT78GH8CQbacm2PV8zNW9 =FLRn -----END PGP SIGNATURE----- --=-n7p/agl5pmDgF+uvgu9F-- --===============7525583402525280150== 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 --===============7525583402525280150==--