qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] monitor: fix crash for platforms without a CPU 0
@ 2016-09-21  5:29 David Gibson
  2016-09-21 11:36 ` Igor Mammedov
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: David Gibson @ 2016-09-21  5:29 UTC (permalink / raw)
  To: qemu-trivial
  Cc: qemu-ppc, qemu-devel, ehabkost, lcapitulino, armbru, imammedo,
	David Gibson, Cédric Le Goater

Now that we allow CPU hot unplug on a few platforms, we can end up in a
situation where we don't have a CPU with index 0.  Or at least we could,
if we didn't have code to explicitly prohibit unplug of CPU 0.

Longer term we want to allow CPU 0 unplug, this patch is an early step in
allowing this, by removing an assumption in the monitor code that CPU 0
always exists.

Signed-off-by: Cédric Le Goater <clg@kaod.org>
[dwg: Rewrote commit message to better explain background]
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
 monitor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Anyone want to volunteer to take this through their tree?  If not, I
can take it through my ppc tree.

diff --git a/monitor.c b/monitor.c
index 8bb8bbf..83c4edf 100644
--- a/monitor.c
+++ b/monitor.c
@@ -1025,7 +1025,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;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-09-22  0:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-21  5:29 [Qemu-devel] [PATCH] monitor: fix crash for platforms without a CPU 0 David Gibson
2016-09-21 11:36 ` Igor Mammedov
2016-09-21 12:14 ` Eduardo Habkost
2016-09-22  0:17   ` David Gibson
2016-09-21 14:50 ` Luiz Capitulino
2016-09-22  0:17   ` David Gibson

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).