qemu-e2k/target-i386
Igor Mammedov d3c64d6a18 target-i386: Split APIC creation from initialization in x86_cpu_realizefn()
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>
2013-04-16 01:19:46 +02:00
..
Makefile.objs x86: switch to AREG0 free mode 2012-08-14 19:01:26 +00:00
TODO
arch_dump.c exec: change RAM list to a TAILQ 2012-12-20 23:08:47 +01:00
arch_memory_mapping.c target-i386: fix bits 39:32 of the final physical address when using 4M page 2013-01-09 15:12:20 -02:00
cc_helper.c target-i386: Add CC_OP_CLR 2013-02-19 23:05:18 -08:00
cc_helper_template.h target-i386: Implement BLSR, BLSMSK, BLSI 2013-02-18 15:52:05 -08:00
cpu-qom.h cpu: Replace do_interrupt() by CPUClass::do_interrupt method 2013-03-12 10:35:55 +01:00
cpu.c target-i386: Split APIC creation from initialization in x86_cpu_realizefn() 2013-04-16 01:19:46 +02:00
cpu.h hw: move headers to include/ 2013-04-08 18:13:10 +02:00
excp_helper.c softmmu: move include files to include/sysemu/ 2012-12-19 08:32:45 +01:00
fpu_helper.c target-i386: add AES-NI instructions 2013-04-13 13:51:57 +02:00
helper.c target-i386: Don't modify env->eflags around cpu_dump_state 2013-03-23 14:30:12 +00:00
helper.h target-i386: Use mulu2 and muls2 2013-02-27 19:06:28 +00:00
hyperv.c
hyperv.h
int_helper.c target-i386: Use mulu2 and muls2 2013-02-27 19:06:28 +00:00
ioport-user.c exec: move include files to include/exec/ 2012-12-19 08:31:31 +01:00
kvm-stub.c
kvm.c hw: move headers to include/ 2013-04-08 18:13:10 +02:00
kvm_i386.h softmmu: move include files to include/sysemu/ 2012-12-19 08:32:45 +01:00
machine.c hw: move headers to include/ 2013-04-08 18:13:10 +02:00
mem_helper.c exec: move include files to include/exec/ 2012-12-19 08:31:31 +01:00
misc_helper.c cpu: Move halted and interrupt_request fields to CPUState 2013-03-12 10:35:55 +01:00
ops_sse.h target-i386: add AES-NI instructions 2013-04-13 13:51:57 +02:00
ops_sse_header.h target-i386: add AES-NI instructions 2013-04-13 13:51:57 +02:00
seg_helper.c cpu: Replace do_interrupt() by CPUClass::do_interrupt method 2013-03-12 10:35:55 +01:00
shift_helper_template.h target-i386: compute eflags outside rcl/rcr helper 2013-02-18 15:03:56 -08:00
smm_helper.c cpu_dump_state: move DUMP_FPU and DUMP_CCOP flags from x86-only to generic 2012-10-05 15:04:43 +01:00
svm.h
svm_helper.c cpu: Move halted and interrupt_request fields to CPUState 2013-03-12 10:35:55 +01:00
topology.h target-i386: Inline bitops_flsl 2013-02-16 11:12:29 +00:00
translate.c target-i386: add AES-NI instructions 2013-04-13 13:51:57 +02:00