@@ -1329,13 +1329,14 @@ int kvm_arch_halt(CPUState *env)
return 1;
}
-void kvm_arch_pre_kvm_run(void *opaque, CPUState *env)
+int kvm_arch_pre_run(CPUState *env, struct kvm_run *run)
{
if (!kvm_irqchip_in_kernel())
kvm_set_cr8(env, cpu_get_apic_tpr(env));
+ return 0;
}
-void kvm_arch_post_kvm_run(void *opaque, CPUState *env)
+int kvm_arch_post_run(CPUState *env, struct kvm_run *run)
{
cpu_single_env = env;
@@ -1344,6 +1345,7 @@ void kvm_arch_post_kvm_run(void *opaque, CPUState *env)
cpu_set_apic_tpr(env, kvm_get_cr8(env));
cpu_set_apic_base(env, kvm_get_apic_base(env));
+ return 0;
}
int kvm_arch_has_work(CPUState *env)
@@ -852,12 +852,12 @@ static inline void push_nmi(kvm_context_t kvm)
void post_kvm_run(kvm_context_t kvm, CPUState *env)
{
pthread_mutex_lock(&qemu_mutex);
- kvm_arch_post_kvm_run(kvm->opaque, env);
+ kvm_arch_post_run(env, env->kvm_run);
}
int pre_kvm_run(kvm_context_t kvm, CPUState *env)
{
- kvm_arch_pre_kvm_run(kvm->opaque, env);
+ kvm_arch_pre_run(env, env->kvm_run);
pthread_mutex_unlock(&qemu_mutex);
return 0;
@@ -965,8 +965,8 @@ void kvm_arch_load_regs(CPUState *env);
void kvm_arch_load_mpstate(CPUState *env);
void kvm_arch_save_mpstate(CPUState *env);
int kvm_arch_init_vcpu(CPUState *cenv);
-void kvm_arch_pre_kvm_run(void *opaque, CPUState *env);
-void kvm_arch_post_kvm_run(void *opaque, CPUState *env);
+int kvm_arch_pre_run(CPUState *env, struct kvm_run *run);
+int kvm_arch_post_run(CPUState *env, struct kvm_run *run);
int kvm_arch_has_work(CPUState *env);
void kvm_arch_process_irqchip_events(CPUState *env);
int kvm_arch_try_push_interrupts(void *opaque);