Received: from eggs.gnu.org ([2001:4830:134:3::10]:49837) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkW49-0002ZC-VG for qemu-devel@nongnu.org; Thu, 15 Sep 2016 08:46:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bkW45-00083A-3N for qemu-devel@nongnu.org; Thu, 15 Sep 2016 08:46:56 -0400 Received: from 1.mo177.mail-out.ovh.net ([178.33.107.143]:46156) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkW44-00082S-Tp for qemu-devel@nongnu.org; Thu, 15 Sep 2016 08:46:53 -0400 Received: from player699.ha.ovh.net (b9.ovh.net [213.186.33.59]) by mo177.mail-out.ovh.net (Postfix) with ESMTP id 47B8CFFCBC1 for ; Thu, 15 Sep 2016 14:46:47 +0200 (CEST) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Date: Thu, 15 Sep 2016 14:45:56 +0200 Message-Id: <1473943560-14846-7-git-send-email-clg@kaod.org> In-Reply-To: <1473943560-14846-1-git-send-email-clg@kaod.org> References: <1473943560-14846-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 v3 06/10] 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, 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 --- monitor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monitor.c b/monitor.c index 5c003731e288..0192209a7915 100644 --- a/monitor.c +++ b/monitor.c @@ -1023,7 +1023,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