mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-11-05 20:35:44 +00:00
d3c64d6a18
When APIC is hotplugged during CPU hotplug, device_set_realized() calls device_reset() on it. And if QEMU runs in KVM mode, following call chain will fail: apic_reset_common() -> kvm_apic_vapic_base_update() -> kvm_vcpu_ioctl(cpu->kvm_fd,...) due to cpu->kvm_fd not being initialized yet. cpu->kvm_fd is initialized during qemu_init_vcpu() but x86_cpu_apic_init() can't be moved after it because kvm_init_vcpu() -> kvm_arch_reset_vcpu() relies on APIC to determine if CPU is BSP for setting initial env->mp_state. So split APIC device creation from its initialization and realize APIC after CPU is created, when it's safe to call APIC's reset method. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: liguang <lig.fnst@cn.fujitsu.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de> |
||
---|---|---|
.. | ||
arch_dump.c | ||
arch_memory_mapping.c | ||
cc_helper.c | ||
cc_helper_template.h | ||
cpu-qom.h | ||
cpu.c | ||
cpu.h | ||
excp_helper.c | ||
fpu_helper.c | ||
helper.c | ||
helper.h | ||
hyperv.c | ||
hyperv.h | ||
int_helper.c | ||
ioport-user.c | ||
kvm-stub.c | ||
kvm.c | ||
kvm_i386.h | ||
machine.c | ||
Makefile.objs | ||
mem_helper.c | ||
misc_helper.c | ||
ops_sse.h | ||
ops_sse_header.h | ||
seg_helper.c | ||
shift_helper_template.h | ||
smm_helper.c | ||
svm.h | ||
svm_helper.c | ||
TODO | ||
topology.h | ||
translate.c |