From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60609) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQTfD-0007sx-KQ for qemu-devel@nongnu.org; Fri, 22 Jul 2016 02:10:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQTf9-0001OH-9Z for qemu-devel@nongnu.org; Fri, 22 Jul 2016 02:10:22 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:40519) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQTf9-0001Mv-0x for qemu-devel@nongnu.org; Fri, 22 Jul 2016 02:10:19 -0400 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u6M646kW012896 for ; Fri, 22 Jul 2016 02:10:15 -0400 Received: from e28smtp01.in.ibm.com (e28smtp01.in.ibm.com [125.16.236.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 24athdph7r-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 22 Jul 2016 02:10:14 -0400 Received: from localhost by e28smtp01.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 22 Jul 2016 11:40:11 +0530 Date: Fri, 22 Jul 2016 11:40:03 +0530 From: Bharata B Rao Reply-To: bharata@linux.vnet.ibm.com References: <1469116479-233280-1-git-send-email-imammedo@redhat.com> <1469116479-233280-7-git-send-email-imammedo@redhat.com> <20160722032301.GG15941@voom.fritz.box> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160722032301.GG15941@voom.fritz.box> Message-Id: <20160722061003.GD7036@in.ibm.com> Subject: Re: [Qemu-devel] [PATCH 6/8] spapr: init CPUState->cpu_index with index relative to core-id List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson Cc: Igor Mammedov , qemu-devel@nongnu.org, Paolo Bonzini , Peter Crosthwaite , Richard Henderson , Eduardo Habkost , "Michael S. Tsirkin" , Alexander Graf , Riku Voipio , qemu-ppc@nongnu.org On Fri, Jul 22, 2016 at 01:23:01PM +1000, David Gibson wrote: > On Thu, Jul 21, 2016 at 05:54:37PM +0200, Igor Mammedov wrote: > > It will enshure that cpu_index for a given cpu stays the same > > regardless of the order cpus has been created/deleted and so > > it would be possible to migrate QEMU instance with out of order > > created CPU. > > > > Signed-off-by: Igor Mammedov > > So, this isn't quite right (it wasn't right in my version either). > > The problem occurs when smp_threads < kvmppc_smt_threads(). That is, > when the requested threads-per-core is less than the hardware's > maximum number of threads-per-core. > > The core-id values are assigned essentially as i * > kvmppc_smt_threads(), meaning the patch below will leave gaps in the > cpu_index values and the last ones will exceed max_cpus, causing other > problems. This would lead to hotplug failures as cpu_dt_id is still being derived from non-contiguous cpu_index resulting in wrong enumeration of CPU nodes in DT. For -smp 8,threads=4 we see the following CPU nodes in DT PowerPC,POWER8@0 PowerPC,POWER8@10 which otherwise should have been PowerPC,POWER8@0 PowerPC,POWER8@8 The problem manifests as drmgr failure. Greg's patchset that moved cpu_dt_id setting to machine code and that derived cpu_dt_id from core-id for sPAPR would be needed to fix this I guess. Regards, Bharata.