[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 08/29] pc: make sure that plugged CPUs are of the sam
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 08/29] pc: make sure that plugged CPUs are of the same type |
Date: |
Wed, 18 Oct 2017 18:12:00 +0200 |
From: Igor Mammedov <address@hidden>
heterogeneous cpus are not supported and hotplugging different
cpu model crashes QEMU:
qemu-system-x86_64 -cpu qemu64 -smp 1,maxcpus=2
(qemu) device_add host-x86_64-cpu,socket-id=1,core-id=0,thread-id=0,id=foo
(qemu) info cpus
error: failed to get MSR 0x38d
qemu-system-x86_64: target/i386/kvm.c:2121: kvm_get_msrs: Assertion `ret ==
cpu->kvm_msr_buf->nmsrs' failed.
Aborted (core dumped)
Gracefully fail hotplug process in case of user mistake.
Reported-by: Greg Kurz <address@hidden>
Signed-off-by: Igor Mammedov <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
hw/i386/pc.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 05985d4..8e307f7 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1876,8 +1876,15 @@ static void pc_cpu_pre_plug(HotplugHandler *hotplug_dev,
CPUArchId *cpu_slot;
X86CPUTopoInfo topo;
X86CPU *cpu = X86_CPU(dev);
+ MachineState *ms = MACHINE(hotplug_dev);
PCMachineState *pcms = PC_MACHINE(hotplug_dev);
+ if(!object_dynamic_cast(OBJECT(cpu), ms->cpu_type)) {
+ error_setg(errp, "Invalid CPU type, expected cpu type: '%s'",
+ ms->cpu_type);
+ return;
+ }
+
/* if APIC ID is not set, set it based on socket/core/thread properties */
if (cpu->apic_id == UNASSIGNED_APIC_ID) {
int max_socket = (max_cpus - 1) / smp_threads / smp_cores;
--
1.8.3.1
- [Qemu-devel] [PULL 00/29] Misc patches for 2017-10-18, Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 02/29] scsi-disk: support reporting of rotation rate, Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 04/29] char: don't skip client cleanup if 'connected' flag is unset, Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 01/29] checkpatch: refine mode selection, Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 07/29] memory: fix off-by-one error in memory_region_notify_one(), Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 05/29] exec: add page_mask for flatview_do_translate, Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 03/29] ide: support reporting of rotation rate, Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 06/29] exec: simplify address_space_get_iotlb_entry, Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 08/29] pc: make sure that plugged CPUs are of the same type,
Paolo Bonzini <=
- [Qemu-devel] [PULL 09/29] disas: Always initialize read_memory_inner_func properly, Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 10/29] build: remove CONFIG_LIBDECNUMBER, Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 13/29] tco: add trace events, Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 11/29] nios2: define tcg_env, Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 17/29] kvm: fix alignment of ram address, Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 15/29] target/i386: trap on instructions longer than >15 bytes, Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 12/29] docs/devel/loads-stores.rst: Document our various load and store APIs, Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 14/29] target/i386: introduce x86_ld*_code, Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 19/29] kvm: fix error message when failing to unregister slot, Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 16/29] memory: call log_start after region_add, Paolo Bonzini, 2017/10/18