From: Glauber Costa <glom...@redhat.com>

this whole tpr thing does not belong in common code. Move it to i386 specific
files.

Signed-off-by: Glauber Costa <glom...@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosa...@redhat.com>

diff --git a/qemu-kvm-x86.c b/qemu-kvm-x86.c
index eb9d13a..0dcbd44 100644
--- a/qemu-kvm-x86.c
+++ b/qemu-kvm-x86.c
@@ -157,6 +157,10 @@ int kvm_arch_create(kvm_context_t kvm, unsigned long 
phys_mem_bytes,
        if (r < 0)
                return r;
 
+#ifdef KVM_EXIT_TPR_ACCESS
+    kvm_tpr_opt_setup();
+#endif
+
        return 0;
 }
 
@@ -1386,6 +1390,9 @@ int kvm_arch_init_vcpu(CPUState *cenv)
     }
 #endif
 
+#ifdef KVM_EXIT_TPR_ACCESS
+    kvm_tpr_vcpu_start(cenv);
+#endif
     return 0;
 }
 
diff --git a/qemu-kvm.c b/qemu-kvm.c
index cc91194..aff87e9 100644
--- a/qemu-kvm.c
+++ b/qemu-kvm.c
@@ -1907,9 +1907,6 @@ static void *ap_main_loop(void *_env)
     cpu_single_env = env;
 
     kvm_arch_init_vcpu(env);
-#ifdef TARGET_I386
-    kvm_tpr_vcpu_start(env);
-#endif
 
     kvm_arch_load_regs(env);
 
@@ -1965,9 +1962,6 @@ int kvm_init_ap(void)
 {
     struct sigaction action;
 
-#ifdef TARGET_I386
-    kvm_tpr_opt_setup();
-#endif
     qemu_add_vm_change_state_handler(kvm_vm_state_change_handler, NULL);
 
     signal(SIG_IPI, sig_ipi_handler);
--
To unsubscribe from this list: send the line "unsubscribe kvm-commits" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to