From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57795) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZzlDz-0001EV-PZ for qemu-devel@nongnu.org; Fri, 20 Nov 2015 07:55:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZzlDv-0000GB-PK for qemu-devel@nongnu.org; Fri, 20 Nov 2015 07:55:35 -0500 Received: from e28smtp08.in.ibm.com ([122.248.162.8]:37874) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZzlDv-0000F8-1J for qemu-devel@nongnu.org; Fri, 20 Nov 2015 07:55:31 -0500 Received: from /spool/local by e28smtp08.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 20 Nov 2015 18:25:28 +0530 From: Bharata B Rao Date: Fri, 20 Nov 2015 18:24:30 +0530 Message-Id: <1448024079-20808-2-git-send-email-bharata@linux.vnet.ibm.com> In-Reply-To: <1448024079-20808-1-git-send-email-bharata@linux.vnet.ibm.com> References: <1448024079-20808-1-git-send-email-bharata@linux.vnet.ibm.com> Subject: [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: qemu-devel@nongnu.org Cc: aik@ozlabs.ru, Bharata B Rao , mdroth@linux.vnet.ibm.com, agraf@suse.de, pbonzini@redhat.com, qemu-ppc@nongnu.org, tyreld@linux.vnet.ibm.com, nfont@linux.vnet.ibm.com, imammedo@redhat.com, afaerber@suse.de, david@gibson.dropbear.id.au 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. 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; -- 2.1.0