From: Marcelo Tosatti <[email protected]>

update_vapic is used for enabling vcpu's vapic on migration.
Use the new writeback states for that.

Signed-off-by: Marcelo Tosatti <[email protected]>
Signed-off-by: Avi Kivity <[email protected]>

diff --git a/qemu-kvm-x86.c b/qemu-kvm-x86.c
index 99754db..24f7495 100644
--- a/qemu-kvm-x86.c
+++ b/qemu-kvm-x86.c
@@ -1020,6 +1020,10 @@ void kvm_arch_load_regs(CPUState *env, int level)
         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;
@@ -1379,9 +1383,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;
--
To unsubscribe from this list: send the line "unsubscribe kvm-commits" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to