From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33451) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a48ZD-0006dq-MS for qemu-devel@nongnu.org; Wed, 02 Dec 2015 09:39:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a48Z8-00057h-Id for qemu-devel@nongnu.org; Wed, 02 Dec 2015 09:39:35 -0500 Received: from e23smtp06.au.ibm.com ([202.81.31.148]:39196) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a48Z8-00056X-1h for qemu-devel@nongnu.org; Wed, 02 Dec 2015 09:39:30 -0500 Received: from localhost by e23smtp06.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 3 Dec 2015 00:39:26 +1000 Date: Wed, 2 Dec 2015 20:08:23 +0530 From: Bharata B Rao Message-ID: <20151202143823.GC21491@in.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> <20151202145239.2b10f96a@nial.brq.redhat.com> <20151202141459.GR23717@thinpad.lan.raisama.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151202141459.GR23717@thinpad.lan.raisama.net> Subject: Re: [Qemu-devel] [PATCH v5 01/10] vl: Don't allow CPU toplogies with partially filled cores Reply-To: bharata@linux.vnet.ibm.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: mdroth@linux.vnet.ibm.com, aik@ozlabs.ru, agraf@suse.de, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, tyreld@linux.vnet.ibm.com, pbonzini@redhat.com, Igor Mammedov , nfont@linux.vnet.ibm.com, afaerber@suse.de, david@gibson.dropbear.id.au On Wed, Dec 02, 2015 at 12:14:59PM -0200, Eduardo Habkost wrote: > On Wed, Dec 02, 2015 at 02:52:39PM +0100, Igor Mammedov wrote: > > 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 > > I am always afraid of introducing fatal errors for configurations > that are obviously wrong but may already exist in production (so > it would prevent users from migrating existing VMs). But I am > becoming more inclined to be a bit more aggressive and stop > allowing these broken configurations. > > But I would rewrite the error message, and just say that "cpus" > and "maxcpus" must be multiples of "threads". It's easier to > understand and explain than what "partially filled cores" mean. > You don't need to mention "sockets" and "cores" in the error > message, either. > > Also, please print different error messages to indicate if > "maxcpus" or "cpus" is the culprit. Sure, makes it easier for the user. > > What about (cpus % (cores * threads) != 0)? It would result in > sockets with different numbers of cores. Should we allow that? I had planned to prevent that and also (max_cpus % (cores * threads) != 0) in the next iteration. Would be good to know if enforcing such a condition would be acceptable. > > The patch makes QEMU crash with the following command-line: > > $ qemu-system-x86_64 -smp 2,cores=2,sockets=2 > Floating point exception (core dumped) > $ > > It can probably be solved by moving the check after > smp_{cpus,cores,threads} are already set. Oh yes, will fix in the next iteration. Regards, Bharata.