diff options
-rw-r--r-- | cpu-defs.h | 2 | ||||
-rw-r--r-- | hw/apic.c | 5 | ||||
-rw-r--r-- | qemu-kvm-x86.c | 43 |
3 files changed, 4 insertions, 46 deletions
diff --git a/cpu-defs.h b/cpu-defs.h index e17209a75..757009648 100644 --- a/cpu-defs.h +++ b/cpu-defs.h @@ -140,8 +140,6 @@ typedef struct CPUWatchpoint { struct qemu_work_item; struct KVMCPUState { - int sipi_needed; - int init; pthread_t thread; int signalled; int stop; @@ -492,9 +492,6 @@ void apic_init_reset(CPUState *env) s->wait_for_sipi = 1; env->halted = !(s->apicbase & MSR_IA32_APICBASE_BSP); - - if (kvm_enabled() && !qemu_kvm_irqchip_in_kernel()) - kvm_apic_init(s->cpu_env); } static void apic_startup(APICState *s, int vector_num) @@ -517,8 +514,6 @@ void apic_sipi(CPUState *env) 0xffff, 0); env->halted = 0; s->wait_for_sipi = 0; - if (kvm_enabled() && !qemu_kvm_irqchip_in_kernel()) - kvm_update_after_sipi(env); } static void apic_deliver(APICState *s, uint8_t dest, uint8_t dest_mode, diff --git a/qemu-kvm-x86.c b/qemu-kvm-x86.c index a78073e01..1eb147e4a 100644 --- a/qemu-kvm-x86.c +++ b/qemu-kvm-x86.c @@ -1576,45 +1576,10 @@ uint32_t kvm_arch_get_supported_cpuid(CPUState *env, uint32_t function, return kvm_get_supported_cpuid(kvm_context, function, reg); } -void kvm_update_after_sipi(CPUState *env) -{ - env->kvm_cpu_state.sipi_needed = 1; - kvm_update_interrupt_request(env); -} - -void kvm_apic_init(CPUState *env) -{ - if (!cpu_is_bsp(env)) - env->kvm_cpu_state.init = 1; - kvm_update_interrupt_request(env); -} - -static void update_regs_for_sipi(CPUState *env) -{ - kvm_arch_update_regs_for_sipi(env); - env->kvm_cpu_state.sipi_needed = 0; -} - -static void update_regs_for_init(CPUState *env) -{ - SegmentCache cs = env->segs[R_CS]; - - cpu_reset(env); - /* cpu_reset() clears env->halted, cpu should be halted after init */ - env->halted = 1; - - /* restore SIPI vector */ - if(env->kvm_cpu_state.sipi_needed) - env->segs[R_CS] = cs; - - env->kvm_cpu_state.init = 0; - kvm_arch_load_regs(env); -} - void kvm_arch_process_irqchip_events(CPUState *env) { - if (env->kvm_cpu_state.init) - update_regs_for_init(env); - if (env->kvm_cpu_state.sipi_needed) - update_regs_for_sipi(env); + if (env->interrupt_request & CPU_INTERRUPT_INIT) + do_cpu_init(env); + if (env->interrupt_request & CPU_INTERRUPT_SIPI) + do_cpu_sipi(env); } |