Received: from eggs.gnu.org ([2001:4830:134:3::10]:34309) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bJHed-0000er-Kh for qemu-devel@nongnu.org; Sat, 02 Jul 2016 05:56:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bJHeY-00063E-NL for qemu-devel@nongnu.org; Sat, 02 Jul 2016 05:56:03 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:5205) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bJHeY-00062r-FT for qemu-devel@nongnu.org; Sat, 02 Jul 2016 05:55:58 -0400 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u629rQ4u072673 for ; Sat, 2 Jul 2016 05:55:56 -0400 Received: from e23smtp06.au.ibm.com (e23smtp06.au.ibm.com [202.81.31.148]) by mx0a-001b2d01.pphosted.com with ESMTP id 23x9pn27ma-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Sat, 02 Jul 2016 05:55:56 -0400 Received: from localhost by e23smtp06.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 2 Jul 2016 19:55:53 +1000 Date: Sat, 2 Jul 2016 15:25:07 +0530 From: Bharata B Rao Reply-To: bharata@linux.vnet.ibm.com References: <146741287399.948.15988269239450224065.stgit@bahia.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <146741287399.948.15988269239450224065.stgit@bahia.lan> Message-Id: <20160702095432.GK21596@in.ibm.com> Subject: Re: [Qemu-devel] [PATCH v2 0/7] ppc: compute cpu_dt_id in the machine code List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Greg Kurz Cc: David Gibson , Benjamin Herrenschmidt , qemu-devel@nongnu.org, Alexander Graf , qemu-ppc@nongnu.org, Cedric Le Goater , Scott Wood , Igor Mammedov On Sat, Jul 02, 2016 at 12:41:14AM +0200, Greg Kurz wrote: > This series is a sequel to the discussion on a patch from Ben's powernv > patchset: > > http://patchwork.ozlabs.org/patch/597153/ > > Indeed, since the DT is a machine abstraction, it should definitely sit > under hw/ppc and not in the target code: > - all machine types are forced to share the same numbering logic > - user mode does not need that => there are #ifdef everywhere > > So this series moves all the current numbering logic to the machine > code. > > The patchset was completely re-written according to Igor's valuable > suggestions. The main change is that cpu_dt_id is now computed out > of a cpu_index provided by the machine, instead of bending the code > to use cs->cpu_index. > > I resend Bharata's patch without any modification because patch 6 is > based on it (pseries-2.7 support). > > I did not see any regression on pseries-2.6, pseries-2.7 and CPU hotplug. Haven't had a chance to debug yet, but just noticed that CPU hotplug seems to have issues after this patchset on mainline. -smp 8,cores=1,threads=4,maxcpus=32 (qemu) device_add host-spapr-cpu-core,id=core1,core-id=16 (qemu) info cpus * CPU #0: nip=0xc00000000007dc6c thread_id=10865 CPU #1: nip=0xc00000000007dc6c thread_id=10866 CPU #2: nip=0xc00000000007dc6c thread_id=10867 CPU #3: nip=0xc00000000007dc6c thread_id=10868 CPU #4: nip=0xc00000000007dc6c thread_id=10869 CPU #5: nip=0xc00000000007dc6c thread_id=10870 CPU #6: nip=0xc00000000007dc6c thread_id=10871 CPU #7: nip=0xc00000000007dc6c thread_id=10872 CPU #8: nip=0x0000000000000000 (halted) thread_id=10948 CPU #9: nip=0x0000000000000000 (halted) thread_id=10949 CPU #10: nip=0x0000000000000000 (halted) thread_id=10950 CPU #11: nip=0x0000000000000000 (halted) thread_id=10951 [root@localhost cpus]# ls #address-cells ibm,drc-power-domains name #size-cells ibm,drc-indexes ibm,drc-types PowerPC,POWER8@0 ibm,drc-names linux,phandle PowerPC,POWER8@10 [root@localhost cpus]# DEBUG: read_rtas_events(): Received RTAS event 1 DEBUG: handle_rtas_event(): Handling RTAS event 1 DEBUG: handle_rtas_event(): Entering check_platform_dump() DEBUG: print_rtas_event(): Writing RTAS event 1 to /var/log/platform DEBUG: handle_rtas_event(): Entering Hotplug handler DEBUG: handle_hotplug_event(): Build drmgr command DEBUG: handle_hotplug_event(): run: drmgr -c cpu -a -s 0x10000010 (null) DEBUG: handle_hotplug_event(): Invoke drmgr command Validating CPU DLPAR capability...yes. Requested CPU with drc index 10000010 is already present. DEBUG: handle_hotplug_event(): drmgr call exited with 1 If instead of core-id=16, if I use core-id=24, then hotplug succeeds but the CPU gets unexpected dt_id(0x30) as shown below: (qemu) device_add host-spapr-cpu-core,id=core2,core-id=24 [root@localhost cpus]# ls #address-cells ibm,drc-power-domains name #size-cells ibm,drc-indexes ibm,drc-types PowerPC,POWER8@0 ibm,drc-names linux,phandle PowerPC,POWER8@10 [root@localhost cpus]# DEBUG: read_rtas_events(): Received RTAS event 1 DEBUG: handle_rtas_event(): Handling RTAS event 1 DEBUG: handle_rtas_event(): Entering check_platform_dump() DEBUG: print_rtas_event(): Writing RTAS event 1 to /var/log/platform DEBUG: handle_rtas_event(): Entering Hotplug handler DEBUG: handle_hotplug_event(): Build drmgr command DEBUG: handle_hotplug_event(): run: drmgr -c cpu -a -s 0x10000018 (null) DEBUG: handle_hotplug_event(): Invoke drmgr command Validating CPU DLPAR capability...yes. Could not retrieve ibm,ppc-interrupt-server#s property for CPU 24 Rotating logs... DEBUG: handle_hotplug_event(): drmgr call exited with 0 DEBUG: process_v6(): Processing version 6 event DEBUG: report_menugoal(): menugoal: number = 651301, message = "Platform Firmware Not applicable." DEBUG: (Sequence #1) servicelog key 96. [root@localhost cpus]# ls #address-cells ibm,drc-power-domains name PowerPC,POWER8@30 ibm,drc-indexes ibm,drc-types PowerPC,POWER8@0 #size-cells ibm,drc-names linux,phandle PowerPC,POWER8@10