From patchwork Mon Oct 19 13:20:43 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Glauber Costa X-Patchwork-Id: 54780 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n9JDLI31016282 for ; Mon, 19 Oct 2009 13:21:18 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756163AbZJSNUr (ORCPT ); Mon, 19 Oct 2009 09:20:47 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756080AbZJSNUq (ORCPT ); Mon, 19 Oct 2009 09:20:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55979 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756153AbZJSNUp (ORCPT ); Mon, 19 Oct 2009 09:20:45 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n9JDKoog020298 for ; Mon, 19 Oct 2009 09:20:50 -0400 Received: from localhost.localdomain (vpn-12-73.rdu.redhat.com [10.11.12.73]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n9JDKjZo029555; Mon, 19 Oct 2009 09:20:49 -0400 From: Glauber Costa To: kvm@vger.kernel.org Cc: avi@redhat.com Subject: [PATCH 2/3] change pre and post kvm_run signatures. Date: Mon, 19 Oct 2009 11:20:43 -0200 Message-Id: <1255958444-18259-3-git-send-email-glommer@redhat.com> In-Reply-To: <1255958444-18259-2-git-send-email-glommer@redhat.com> References: <1255958444-18259-1-git-send-email-glommer@redhat.com> <1255958444-18259-2-git-send-email-glommer@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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);