From: "Jan Beulich" Subject: Re: [PATCH 3/3] x86_64: allow more vCPU-s per guest Date: Thu, 18 Jun 2009 12:50:51 +0100 Message-ID: <4A3A463B0200007800006838@vpn.id2.novell.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org >>> Keir Fraser 18.06.09 11:39 >>> > Then I think it would be better to make that domctl really singleshot = (i.e., > fail if d->max_vcpus is already non-zero), with a comment explaining why = it > is implemented this way. Buggily implementing an unused case can't be = good. > Can you generate a patch for this, please? Here we go: Signed-off-by: Jan Beulich --- 2009-06-10.orig/xen/common/domctl.c 2009-06-10 15:04:45.000000000 = +0200 +++ 2009-06-10/xen/common/domctl.c 2009-06-18 13:48:30.000000000 = +0200 @@ -463,6 +463,16 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domc if ( (max < d->max_vcpus) && (d->vcpu[max] !=3D NULL) ) goto maxvcpu_out; =20 + /* + * For now don't allow increasing the vcpu count from a non-zero + * value: This code and all readers of d->vcpu would otherwise = need + * to be converted to use RCU, but at present there's no tools = side + * code path that would issue such a request. + */ + ret =3D -EBUSY; + if ( (d->max_vcpus > 0) && (max > d->max_vcpus) ) + goto maxvcpu_out; + ret =3D -ENOMEM; if ( max > d->max_vcpus ) {