Received: from eggs.gnu.org ([2001:4830:134:3::10]:38485) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bJIFs-0007ta-SM for qemu-devel@nongnu.org; Sat, 02 Jul 2016 06:34:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bJIFo-0005d4-ED for qemu-devel@nongnu.org; Sat, 02 Jul 2016 06:34:31 -0400 Received: from 9.mo69.mail-out.ovh.net ([46.105.56.78]:59170) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bJIFo-0005bB-3f for qemu-devel@nongnu.org; Sat, 02 Jul 2016 06:34:28 -0400 Received: from player789.ha.ovh.net (b9.ovh.net [213.186.33.59]) by mo69.mail-out.ovh.net (Postfix) with ESMTP id 756F0FFC8D9 for ; Sat, 2 Jul 2016 12:34:26 +0200 (CEST) Date: Sat, 2 Jul 2016 12:34:13 +0200 From: Greg Kurz Message-ID: <20160702123413.07c966b0@bahia.lan> In-Reply-To: <20160702095432.GK21596@in.ibm.com> References: <146741287399.948.15988269239450224065.stgit@bahia.lan> <20160702095432.GK21596@in.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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: Bharata B Rao Cc: David Gibson , Benjamin Herrenschmidt , qemu-devel@nongnu.org, Alexander Graf , qemu-ppc@nongnu.org, Cedric Le Goater , Scott Wood , Igor Mammedov On Sat, 2 Jul 2016 15:25:07 +0530 Bharata B Rao wrote: > 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. > I forgot to mention this patchset is based on David's ppc-for-2.7 tree. I'll give a try with 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 >