summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGleb Natapov <gleb@redhat.com>2009-06-28 18:46:08 +0300
committerAvi Kivity <avi@redhat.com>2009-06-29 12:11:24 +0300
commite4318a961365f47e6b60b6f0a46d9cdfaa0b4272 (patch)
tree7403349e75432ccea29892901762afbbb291ed7e /qemu-kvm-x86.c
parentOnly compile KVM support for matching CPU types (diff)
downloadqemu-kvm-e4318a961365f47e6b60b6f0a46d9cdfaa0b4272.tar.gz
qemu-kvm-e4318a961365f47e6b60b6f0a46d9cdfaa0b4272.tar.bz2
qemu-kvm-e4318a961365f47e6b60b6f0a46d9cdfaa0b4272.zip
Use upstream QEMU apic init/sipi handling
Remove KVM specific init/sipi handling from hw/apic.c. Now when upstream QEMU handles init/sipi in a cpu loop KVM can do the same. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'qemu-kvm-x86.c')
-rw-r--r--qemu-kvm-x86.c43
1 files changed, 4 insertions, 39 deletions
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);
}