Received: from eggs.gnu.org ([2001:4830:134:3::10]:36461) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aPAhN-00057b-6W for qemu-devel@nongnu.org; Fri, 29 Jan 2016 10:11:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aPAhK-0007mA-13 for qemu-devel@nongnu.org; Fri, 29 Jan 2016 10:10:57 -0500 Date: Fri, 29 Jan 2016 16:10:47 +0100 From: Igor Mammedov Message-ID: <20160129161047.426c3d8f@nial.brq.redhat.com> In-Reply-To: <20160129142418.GY3869@thinpad.lan.raisama.net> References: <1453960195-15181-1-git-send-email-bharata@linux.vnet.ibm.com> <1453960195-15181-2-git-send-email-bharata@linux.vnet.ibm.com> <20160129035230.GL23043@voom.redhat.com> <20160129142418.GY3869@thinpad.lan.raisama.net> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v7 01/13] machine: Don't allow CPU toplogies with partially filled cores List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: mjrosato@linux.vnet.ibm.com, qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com, agraf@suse.de, aik@ozlabs.ru, pbonzini@redhat.com, qemu-ppc@nongnu.org, tyreld@linux.vnet.ibm.com, Bharata B Rao , nfont@linux.vnet.ibm.com, afaerber@suse.de, David Gibson On Fri, 29 Jan 2016 12:24:18 -0200 Eduardo Habkost wrote: > On Fri, Jan 29, 2016 at 02:52:30PM +1100, David Gibson wrote: > > On Thu, Jan 28, 2016 at 11:19:43AM +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. > > > > > > This is enforced by introducing MachineClass::validate_smp_config() > > > that gets called from generic SMP parsing code. Machine type versions > > > that want to enforce this can define this to the generic version > > > provided. > > > > > > Only sPAPR and PC machine types starting from version 2.6 enforce this in > > > this patch. > > > > > > Signed-off-by: Bharata B Rao > > > > I've been kind of lost in the back and forth about > > threads/cores/sockets. > > > > What, in the end, is the rationale for allowing partially filled > > sockets, but not partially filled cores? > > I don't think there's a good reason for that (at least for PC). > > It's easier to relax the requirements later if necessary, than > dealing with compatibility issues again when making the code more > strict. So I suggest we make validate_smp_config_generic() also > check if smp_cpus % (smp_threads * smp_cores) == 0. that would break exiting setups. Also in case of cpu hotplug this patch will break migration as target QEMU might refuse starting with hotplugged CPU thread. Perhaps this check should be enforced per target/machine if arch requires it.