From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43745) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a47q0-0001ru-2E for qemu-devel@nongnu.org; Wed, 02 Dec 2015 08:52:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a47pv-0005Hy-2W for qemu-devel@nongnu.org; Wed, 02 Dec 2015 08:52:51 -0500 Date: Wed, 2 Dec 2015 14:52:39 +0100 From: Igor Mammedov Message-ID: <20151202145239.2b10f96a@nial.brq.redhat.com> In-Reply-To: <1448024079-20808-2-git-send-email-bharata@linux.vnet.ibm.com> References: <1448024079-20808-1-git-send-email-bharata@linux.vnet.ibm.com> <1448024079-20808-2-git-send-email-bharata@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v5 01/10] vl: Don't allow CPU toplogies with partially filled cores List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Bharata B Rao Cc: mdroth@linux.vnet.ibm.com, aik@ozlabs.ru, agraf@suse.de, Eduardo Habkost , qemu-devel@nongnu.org, qemu-ppc@nongnu.org, tyreld@linux.vnet.ibm.com, nfont@linux.vnet.ibm.com, pbonzini@redhat.com, afaerber@suse.de, david@gibson.dropbear.id.au On Fri, 20 Nov 2015 18:24:30 +0530 Bharata B Rao wrote: > Prevent guests from booting with CPU topologies that have partially > filled CPU cores or can result in partially filled CPU cores after > CPU hotplug like > > -smp 15,sockets=1,cores=4,threads=4,maxcpus=16 or > -smp 15,sockets=1,cores=4,threads=4,maxcpus=17. CCing Eduardo who might tell if it's ok wrt x86 > > Signed-off-by: Bharata B Rao > --- > vl.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/vl.c b/vl.c > index 7d993a5..23a1a1e 100644 > --- a/vl.c > +++ b/vl.c > @@ -1248,6 +1248,15 @@ static void smp_parse(QemuOpts *opts) > exit(1); > } > > + if (cpus % threads || max_cpus % threads) { > + error_report("cpu topology: " > + "sockets (%u) cores (%u) threads (%u) with " > + "smp_cpus (%u) maxcpus (%u) " > + "will result in partially filled cores", > + sockets, cores, threads, cpus, max_cpus); > + exit(1); > + } > + > smp_cpus = cpus; > smp_cores = cores > 0 ? cores : 1; > smp_threads = threads > 0 ? threads : 1;