Intention is to merge with upstream version in the following patch. Doing as a separate step to help identify any further issues. Signed-off-by: Glauber Costa <glommer@xxxxxxxxxx> --- qemu-kvm-x86.c | 6 ++++-- qemu-kvm.c | 4 ++-- qemu-kvm.h | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/qemu-kvm-x86.c b/qemu-kvm-x86.c index 350e5fd..b9ffabb 100644 --- a/qemu-kvm-x86.c +++ b/qemu-kvm-x86.c @@ -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) diff --git a/qemu-kvm.c b/qemu-kvm.c index ad00560..a883a48 100644 --- a/qemu-kvm.c +++ b/qemu-kvm.c @@ -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; diff --git a/qemu-kvm.h b/qemu-kvm.h index 06507a6..b84fed1 100644 --- a/qemu-kvm.h +++ b/qemu-kvm.h @@ -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); -- 1.6.2.5 -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html