From patchwork Wed Aug 31 16:34:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?C=C3=A9dric_Le_Goater?= X-Patchwork-Id: 664617 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3sPWVH58brz9sCY for ; Thu, 1 Sep 2016 02:45:59 +1000 (AEST) Received: from localhost ([::1]:55092 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bf8eD-0000q6-N4 for incoming@patchwork.ozlabs.org; Wed, 31 Aug 2016 12:45:57 -0400 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) Received: from hermes.kaod.org.com (LFbn-1-2234-107.w90-76.abo.wanadoo.fr [90.76.55.107]) (Authenticated sender: clg@kaod.org) by player159.ha.ovh.net (Postfix) with ESMTPSA id 854B848009A; Wed, 31 Aug 2016 18:36:00 +0200 (CEST) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-ppc@nongnu.org Date: Wed, 31 Aug 2016 18:34:15 +0200 Message-Id: <1472661255-20160-8-git-send-email-clg@kaod.org> X-Mailer: git-send-email 2.7.4 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 X-Ovh-Tracer-Id: 537617205657307987 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeeluddrgeelgddtfeculddtuddrfeeltddrtddtmdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 87.98.186.128 Subject: [Qemu-devel] [PATCH v2 7/7] monitor: fix crash for platforms without a CPU 0 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexander Graf , qemu-devel@nongnu.org, Cedric Le Goater , David Gibson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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édric Le Goater --- So that you can dump the cpu list with the monitor : (qemu) info cpus * CPU #8: nip=0x0000000000000010 thread_id=7742 CPU #16: nip=0x0000000000000010 thread_id=7740 CPU #24: nip=0x0000000000000010 thread_id=7740 CPU #32: nip=0x0000000000000010 thread_id=7740 CPU #40: nip=0x0000000000000010 thread_id=7740 CPU #48: nip=0x0000000000000010 thread_id=7740 CPU #72: nip=0x0000000000000010 thread_id=7740 CPU #80: nip=0x0000000000000010 thread_id=7740 CPU #136: nip=0x0000000000000010 thread_id=7740 CPU #144: nip=0x0000000000000010 thread_id=7740 CPU #152: nip=0x0000000000000010 thread_id=7740 CPU #160: nip=0x0000000000000010 thread_id=7740 CPU #168: nip=0x0000000000000010 thread_id=7740 CPU #176: nip=0x0000000000000010 thread_id=7740 CPU #200: nip=0x0000000000000010 thread_id=7740 CPU #208: nip=0x0000000000000010 thread_id=7740 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;