From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39077) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhSEI-0005RE-WB for qemu-devel@nongnu.org; Tue, 06 Sep 2016 22:04:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bhSED-00082k-RD for qemu-devel@nongnu.org; Tue, 06 Sep 2016 22:04:45 -0400 Date: Wed, 7 Sep 2016 11:49:11 +1000 From: David Gibson Message-ID: <20160907014911.GC2780@voom.fritz.box> References: <1472661255-20160-1-git-send-email-clg@kaod.org> <1472661255-20160-8-git-send-email-clg@kaod.org> <20160905042709.GE3816@voom.fritz.box> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ZmUaFz6apKcXQszQ" Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH v2 7/7] monitor: fix crash for platforms without a CPU 0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?iso-8859-1?Q?C=E9dric?= Le Goater Cc: qemu-ppc@nongnu.org, Benjamin Herrenschmidt , qemu-devel@nongnu.org, Alexander Graf --ZmUaFz6apKcXQszQ Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Sep 06, 2016 at 08:28:48AM +0200, C=E9dric Le Goater wrote: > On 09/05/2016 06:27 AM, David Gibson wrote: > > On Wed, Aug 31, 2016 at 06:34:15PM +0200, C=E9dric Le Goater wrote: > >> On PowerNV, CPU ids start at 0x8 or 0x20, we don't have a CPU 0 > >> anymore. So let's use the first_cpu index to initialize the monitor. > >> > >> Signed-off-by: C=E9dric Le Goater > >=20 > > So we need a patch like this - amongst other fixes - in order to allow > > unplug of cpu 0. I'm not really sure whether to push it ahead now, or > > gather it up with other no-cpu-0 fixes and send them as a batch. >=20 > I think we could send it now as it removes an assumption on the cpu=20 > number. True enough. I'll try to queue it once I've sorted out my first 2.8 pull request with the existing backlog. >=20 > C.=20 >=20 >=20 > >=20 > >> --- > >> > >> So that you can dump the cpu list with the monitor : > >> > >> (qemu) info cpus > >> * CPU #8: nip=3D0x0000000000000010 thread_id=3D7742 > >> CPU #16: nip=3D0x0000000000000010 thread_id=3D7740 > >> CPU #24: nip=3D0x0000000000000010 thread_id=3D7740 > >> CPU #32: nip=3D0x0000000000000010 thread_id=3D7740 > >> CPU #40: nip=3D0x0000000000000010 thread_id=3D7740 > >> CPU #48: nip=3D0x0000000000000010 thread_id=3D7740 > >> CPU #72: nip=3D0x0000000000000010 thread_id=3D7740 > >> CPU #80: nip=3D0x0000000000000010 thread_id=3D7740 > >> CPU #136: nip=3D0x0000000000000010 thread_id=3D7740 > >> CPU #144: nip=3D0x0000000000000010 thread_id=3D7740 > >> CPU #152: nip=3D0x0000000000000010 thread_id=3D7740 > >> CPU #160: nip=3D0x0000000000000010 thread_id=3D7740 > >> CPU #168: nip=3D0x0000000000000010 thread_id=3D7740 > >> CPU #176: nip=3D0x0000000000000010 thread_id=3D7740 > >> CPU #200: nip=3D0x0000000000000010 thread_id=3D7740 > >> CPU #208: nip=3D0x0000000000000010 thread_id=3D7740 > >> > >> monitor.c | 2 +- > >> 1 file changed, 1 insertion(+), 1 deletion(-) > >> > >> diff --git a/monitor.c b/monitor.c > >> index e9009de09a6c..19b8ec14f40e 100644 > >> --- a/monitor.c > >> +++ b/monitor.c > >> @@ -1027,7 +1027,7 @@ int monitor_set_cpu(int cpu_index) > >> CPUState *mon_get_cpu(void) > >> { > >> if (!cur_mon->mon_cpu) { > >> - monitor_set_cpu(0); > >> + monitor_set_cpu(first_cpu->cpu_index); > >> } > >> cpu_synchronize_state(cur_mon->mon_cpu); > >> return cur_mon->mon_cpu; > >=20 >=20 --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --ZmUaFz6apKcXQszQ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBAgAGBQJXz3IXAAoJEGw4ysog2bOSlD8P/1aTIi1JOll2KWkKJS5Kjbe5 CCfaYg5DyucjQxtWOnX9H2lppkC9SWofoMLMDJZU5S83sOdLLh25S7XyRkZazR17 pt21wJlaK4Sm0HMDxb+827P6rLhOSlavznSBTqHhoDlTFa7D/3ucQtwc1f1nP96f gBMwuJ8g8LoDZYmNOe6x0t2UiA69BkV/0zigw7rq5bYOI0ZpO9wH/OwzxZMJ+HtI mREXgzD1leXU5uU99hRFr5QbUPHmSKWVwGr302ohOsNPEmr5Xo3XczT+49as8jU9 ntBxE1SjlvCsSlBVywMjRbsngoBBXqhNv0CqckAj+jdUCQ+m0UVHZ24OozmKwyUZ CxgvpH6kgZqQ0QQVVdmCAtXk3QqG+d6g2u3nga7IRJXgBTNi5T9FDs9fMRF84erC UMxBq15QP/lGs0dMCuqm9y+uQHqGJQXIvPKw45UrN6KmuY0uCQ+2mmvp13UWxlS/ yCyPeddCQFYA4x+mVvhG2LHDQbzM4rPf8NMq0+2IYyIlMF3APGe5TpqUMjuC+anY g7nLiv2EeP6kBZADR8ha1BontIZ70fr6Eswc83Kihv3iR82dbLt/3zNpishGC5tT zffef8j4o7UROWc4WjIWDdG5aDstFhfNF9eNIQzBuma97UFYIPLG6r+1gv9B5d4T 8pOiXQ40RUssOdyvP2LC =fMd1 -----END PGP SIGNATURE----- --ZmUaFz6apKcXQszQ--