From patchwork Mon Oct 19 13:20:44 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Glauber Costa X-Patchwork-Id: 54781 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 n9JDLI32016282 for ; Mon, 19 Oct 2009 13:21:19 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756153AbZJSNUs (ORCPT ); Mon, 19 Oct 2009 09:20:48 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756080AbZJSNUs (ORCPT ); Mon, 19 Oct 2009 09:20:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54381 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756153AbZJSNUr (ORCPT ); Mon, 19 Oct 2009 09:20:47 -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 n9JDKphc001340 for ; Mon, 19 Oct 2009 09:20:52 -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 n9JDKjZp029555; Mon, 19 Oct 2009 09:20:50 -0400 From: Glauber Costa To: kvm@vger.kernel.org Cc: avi@redhat.com Subject: [PATCH 3/3] use upstream version of kvm_arch_post_run Date: Mon, 19 Oct 2009 11:20:44 -0200 Message-Id: <1255958444-18259-4-git-send-email-glommer@redhat.com> In-Reply-To: <1255958444-18259-3-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> <1255958444-18259-3-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 b9ffabb..db0b351 100644 --- a/qemu-kvm-x86.c +++ b/qemu-kvm-x86.c @@ -515,21 +515,11 @@ void kvm_show_regs(CPUState *env) sregs.efer); } -static uint64_t kvm_get_apic_base(CPUState *env) -{ - return env->kvm_run->apic_base; -} - static void kvm_set_cr8(CPUState *env, uint64_t cr8) { env->kvm_run->cr8 = cr8; } -static __u64 kvm_get_cr8(CPUState *env) -{ - return env->kvm_run->cr8; -} - int kvm_setup_cpuid(CPUState *env, int nent, struct kvm_cpuid_entry *entries) { @@ -1336,18 +1326,6 @@ int kvm_arch_pre_run(CPUState *env, struct kvm_run *run) return 0; } -int kvm_arch_post_run(CPUState *env, struct kvm_run *run) -{ - cpu_single_env = env; - - env->eflags = kvm_get_interrupt_flag(env) - ? env->eflags | IF_MASK : env->eflags & ~IF_MASK; - - 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) { if (((env->interrupt_request & CPU_INTERRUPT_HARD) && diff --git a/qemu-kvm.c b/qemu-kvm.c index a883a48..57d8b1a 100644 --- a/qemu-kvm.c +++ b/qemu-kvm.c @@ -863,11 +863,6 @@ int pre_kvm_run(kvm_context_t kvm, CPUState *env) return 0; } -int kvm_get_interrupt_flag(CPUState *env) -{ - return env->kvm_run->if_flag; -} - int kvm_is_ready_for_interrupt_injection(CPUState *env) { return env->kvm_run->ready_for_interrupt_injection; diff --git a/qemu-kvm.h b/qemu-kvm.h index b84fed1..57c8c86 100644 --- a/qemu-kvm.h +++ b/qemu-kvm.h @@ -190,17 +190,6 @@ void kvm_create_irqchip(kvm_context_t kvm); int kvm_run(CPUState *env); /*! - * \brief Get interrupt flag from on last exit to userspace - * - * This gets the CPU interrupt flag as it was on the last exit to userspace. - * - * \param kvm Pointer to the current kvm_context - * \param vcpu Which virtual CPU should get dumped - * \return interrupt flag value (0 or 1) - */ -int kvm_get_interrupt_flag(CPUState *env); - -/*! * \brief Check if a vcpu is ready for interrupt injection * * This checks if vcpu interrupts are not masked by mov ss or sti. diff --git a/target-i386/kvm.c b/target-i386/kvm.c index 1cf0dc3..24c9903 100644 --- a/target-i386/kvm.c +++ b/target-i386/kvm.c @@ -748,6 +748,7 @@ int kvm_arch_pre_run(CPUState *env, struct kvm_run *run) return 0; } +#endif int kvm_arch_post_run(CPUState *env, struct kvm_run *run) { @@ -762,6 +763,7 @@ int kvm_arch_post_run(CPUState *env, struct kvm_run *run) return 0; } +#ifdef KVM_UPSTREAM static int kvm_handle_halt(CPUState *env) { if (!((env->interrupt_request & CPU_INTERRUPT_HARD) &&