Received: from eggs.gnu.org ([2001:4830:134:3::10]:52925) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bf8Un-0007ic-EB for qemu-devel@nongnu.org; Wed, 31 Aug 2016 12:36:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bf8Uh-0002vU-Th for qemu-devel@nongnu.org; Wed, 31 Aug 2016 12:36:12 -0400 Received: from 9.mo53.mail-out.ovh.net ([87.98.186.128]:35093) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bf8Uh-0002vJ-No for qemu-devel@nongnu.org; Wed, 31 Aug 2016 12:36:07 -0400 Received: from player159.ha.ovh.net (b9.ovh.net [213.186.33.59]) by mo53.mail-out.ovh.net (Postfix) with ESMTP id D7CEF43D83 for ; Wed, 31 Aug 2016 18:36:06 +0200 (CEST) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Date: Wed, 31 Aug 2016 18:34:15 +0200 Message-Id: <1472661255-20160-8-git-send-email-clg@kaod.org> In-Reply-To: <1472661255-20160-1-git-send-email-clg@kaod.org> References: <1472661255-20160-1-git-send-email-clg@kaod.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [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: qemu-ppc@nongnu.org Cc: David Gibson , Benjamin Herrenschmidt , qemu-devel@nongnu.org, Alexander Graf , Cedric Le Goater 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=C3=A9dric Le Goater --- 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 2.7.4