On Sat, 2 Jul 2016 15:25:07 +0530 Bharata B Rao <bhar...@linux.vnet.ibm.com> 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 >