[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 17/35] pc: fix crash in rtc_set_memory() if initial c
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 17/35] pc: fix crash in rtc_set_memory() if initial cpu is marked as hotplugged |
Date: |
Fri, 20 Jan 2017 14:31:21 +0100 |
From: Igor Mammedov <address@hidden>
'hotplugged' propperty is meant to be used on migration side when migrating
source with hotplugged devices.
However though it not exacly correct usage of 'hotplugged' property
it's possible to set generic hotplugged property for CPU using
-cpu foo,hotplugged=on
or
-global foo.hotplugged=on
in this case qemu crashes with following backtrace:
...
because pc_cpu_plug() assumes that hotplugged CPU could appear only after
rtc/fw_cfg are initialized.
Fix crash by replacing assumption with explicit checks of rtc/fw_cfg
and updating them only if they were initialized.
Cc: address@hidden
Reported-by: Eduardo Habkost <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
Signed-off-by: Igor Mammedov <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
hw/i386/pc.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 25e8586..f721fde 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1820,8 +1820,10 @@ static void pc_cpu_plug(HotplugHandler *hotplug_dev,
/* increment the number of CPUs */
pcms->boot_cpus++;
- if (dev->hotplugged) {
+ if (pcms->rtc) {
rtc_set_cpus_count(pcms->rtc, pcms->boot_cpus);
+ }
+ if (pcms->fw_cfg) {
fw_cfg_modify_i16(pcms->fw_cfg, FW_CFG_NB_CPUS, pcms->boot_cpus);
}
--
2.9.3
- [Qemu-devel] [PULL 06/35] stubs: move smbios stubs to hw/smbios, (continued)
- [Qemu-devel] [PULL 06/35] stubs: move smbios stubs to hw/smbios, Paolo Bonzini, 2017/01/20
- [Qemu-devel] [PULL 09/35] hw: move reset handlers from vl.c to hw/core, Paolo Bonzini, 2017/01/20
- [Qemu-devel] [PULL 12/35] stubs: move vhost stubs to stubs/vhost.o, Paolo Bonzini, 2017/01/20
- [Qemu-devel] [PULL 10/35] stubs: group stubs for user-mode emulation, Paolo Bonzini, 2017/01/20
- [Qemu-devel] [PULL 14/35] build: remove --enable-colo/--disable-colo, Paolo Bonzini, 2017/01/20
- [Qemu-devel] [PULL 13/35] event_notifier: cleanups around event_notifier_set_handler, Paolo Bonzini, 2017/01/20
- [Qemu-devel] [PULL 11/35] stubs: group all monitor_fdset_* functions in a single file, Paolo Bonzini, 2017/01/20
- [Qemu-devel] [PULL 16/35] acpi: filter based on CONFIG_ACPI_X86 rather than TARGET, Paolo Bonzini, 2017/01/20
- [Qemu-devel] [PULL 15/35] stubs: remove stubs/kvm.c, Paolo Bonzini, 2017/01/20
- [Qemu-devel] [PULL 18/35] scsi-block: fix direction of BYTCHK test for VERIFY commands, Paolo Bonzini, 2017/01/20
- [Qemu-devel] [PULL 17/35] pc: fix crash in rtc_set_memory() if initial cpu is marked as hotplugged,
Paolo Bonzini <=
- [Qemu-devel] [PULL 19/35] serial: fix memory leak in serial exit, Paolo Bonzini, 2017/01/20
- [Qemu-devel] [PULL 20/35] qemu-thread: fix qemu_thread_set_name() race in qemu_thread_create(), Paolo Bonzini, 2017/01/20
- [Qemu-devel] [PULL 21/35] hxtool: emit Texinfo headings as @subsection, Paolo Bonzini, 2017/01/20
- [Qemu-devel] [PULL 25/35] exec: Add missing rcu_read_unlock, Paolo Bonzini, 2017/01/20
- [Qemu-devel] [PULL 22/35] x86: ioapic: add traces for ioapic, Paolo Bonzini, 2017/01/20
- [Qemu-devel] [PULL 24/35] x86: ioapic: fix fail migration when irqchip=split, Paolo Bonzini, 2017/01/20
- [Qemu-devel] [PULL 23/35] x86: ioapic: dump version for "info ioapic", Paolo Bonzini, 2017/01/20
- [Qemu-devel] [PULL 26/35] char: fix ctrl-a b not working, Paolo Bonzini, 2017/01/20