diff mbox

[1/7] qemu-kvm: move vapic enablement to kvm_arch_load_regs

Message ID 20100309004834.539295724@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Marcelo Tosatti March 9, 2010, 12:47 a.m. UTC
None
diff mbox

Patch

Index: qemu-kvm-tpr/qemu-kvm-x86.c
===================================================================
--- qemu-kvm-tpr.orig/qemu-kvm-x86.c
+++ qemu-kvm-tpr/qemu-kvm-x86.c
@@ -988,6 +988,10 @@  void kvm_arch_load_regs(CPUState *env, i
         kvm_arch_load_mpstate(env);
         kvm_load_lapic(env);
     }
+    if (level == KVM_PUT_FULL_STATE) {
+        if (env->update_vapic)
+            kvm_tpr_enable_vapic(env);
+    }
     if (kvm_irqchip_in_kernel()) {
         /* Avoid deadlock: no user space IRQ will ever clear it. */
         env->halted = 0;
@@ -1338,9 +1342,6 @@  int kvm_arch_halt(CPUState *env)
 
 int kvm_arch_pre_run(CPUState *env, struct kvm_run *run)
 {
-    if (env->update_vapic) {
-        kvm_tpr_enable_vapic(env);
-    }
     if (!kvm_irqchip_in_kernel())
 	kvm_set_cr8(env, cpu_get_apic_tpr(env));
     return 0;