qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Bharata B Rao <bharata@linux.vnet.ibm.com>
To: Greg Kurz <groug@kaod.org>
Cc: David Gibson <david@gibson.dropbear.id.au>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	qemu-devel@nongnu.org, Alexander Graf <agraf@suse.de>,
	qemu-ppc@nongnu.org, Cedric Le Goater <clg@kaod.org>,
	Scott Wood <scottwood@freescale.com>,
	Igor Mammedov <imammedo@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2 0/7] ppc: compute cpu_dt_id in the machine code
Date: Sat, 2 Jul 2016 15:25:07 +0530	[thread overview]
Message-ID: <20160702095432.GK21596@in.ibm.com> (raw)
In-Reply-To: <146741287399.948.15988269239450224065.stgit@bahia.lan>

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

  parent reply	other threads:[~2016-07-02  9:56 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-01 22:41 [Qemu-devel] [PATCH v2 0/7] ppc: compute cpu_dt_id in the machine code Greg Kurz
2016-07-01 22:41 ` [Qemu-devel] [PATCH v2 1/7] spapr: Ensure thread0 of CPU core is always realized first Greg Kurz
2016-07-01 22:41 ` [Qemu-devel] [PATCH v2 2/7] ppc: simplify max_smt initialization in ppc_cpu_realizefn() Greg Kurz
2016-07-04  3:53   ` David Gibson
2016-07-01 22:41 ` [Qemu-devel] [PATCH v2 3/7] ppc: different creation paths for cpus in system and user mode Greg Kurz
2016-07-04  7:14   ` Igor Mammedov
2016-07-04  7:40     ` Greg Kurz
2016-07-01 22:41 ` [Qemu-devel] [PATCH v2 4/7] ppc: open code cpu creation for machine types Greg Kurz
2016-07-02  8:06   ` Bharata B Rao
2016-07-02  8:33     ` Greg Kurz
2016-07-04  3:54       ` David Gibson
2016-07-04  6:32         ` Greg Kurz
2016-07-04  8:08           ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
2016-07-04  7:37         ` [Qemu-devel] " Igor Mammedov
2016-07-04  8:09           ` David Gibson
2016-07-01 22:41 ` [Qemu-devel] [PATCH v2 5/7] ppc: introduce ppc_set_vcpu_dt_id() Greg Kurz
2016-07-01 22:42 ` [Qemu-devel] [PATCH v2 6/7] spapr: use ppc_set_vcpu_dt_id() in CPU hotplug code Greg Kurz
2016-07-02  8:14   ` Bharata B Rao
2016-07-02  8:35     ` Greg Kurz
2016-07-01 22:42 ` [Qemu-devel] [PATCH v2 7/7] ppc: move the cpu_dt_id logic to machine code Greg Kurz
2016-07-02  8:15   ` Bharata B Rao
2016-07-02  8:42     ` Greg Kurz
2016-07-02  9:55 ` Bharata B Rao [this message]
2016-07-02 10:34   ` [Qemu-devel] [PATCH v2 0/7] ppc: compute cpu_dt_id in the " Greg Kurz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160702095432.GK21596@in.ibm.com \
    --to=bharata@linux.vnet.ibm.com \
    --cc=agraf@suse.de \
    --cc=benh@kernel.crashing.org \
    --cc=clg@kaod.org \
    --cc=david@gibson.dropbear.id.au \
    --cc=groug@kaod.org \
    --cc=imammedo@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=scottwood@freescale.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).