===================================================================
@@ -401,10 +401,12 @@ static void vtpr_ioport_write(void *opaq
kvm_tpr_enable_vapic(env);
}
-void kvm_tpr_opt_setup(void)
+static void kvm_tpr_opt_setup(void)
{
register_savevm("kvm-tpr-opt", 0, 1, tpr_save, tpr_load, NULL);
register_ioport_write(0x7e, 1, 1, vtpr_ioport_write, NULL);
register_ioport_write(0x7e, 2, 2, vtpr_ioport_write16, NULL);
}
+device_init(kvm_tpr_opt_setup);
+
===================================================================
@@ -157,10 +157,6 @@ int kvm_arch_create(kvm_context_t kvm, u
if (r < 0)
return r;
-#ifdef KVM_EXIT_TPR_ACCESS
- kvm_tpr_opt_setup();
-#endif
-
return 0;
}
===================================================================
@@ -894,7 +894,6 @@ void qemu_kvm_aio_wait_end(void);
void qemu_kvm_notify_work(void);
-void kvm_tpr_opt_setup(void);
void kvm_tpr_access_report(CPUState *env, uint64_t rip, int is_write);
void kvm_tpr_vcpu_start(CPUState *env);