From patchwork Fri Oct 9 18:03:14 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Glauber Costa X-Patchwork-Id: 52778 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 n99I6uNw012234 for ; Fri, 9 Oct 2009 18:06:57 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933898AbZJISD7 (ORCPT ); Fri, 9 Oct 2009 14:03:59 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932914AbZJISD7 (ORCPT ); Fri, 9 Oct 2009 14:03:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:14423 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932888AbZJISD5 (ORCPT ); Fri, 9 Oct 2009 14:03:57 -0400 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n99I3VRU009343 for ; Fri, 9 Oct 2009 14:03:31 -0400 Received: from localhost.localdomain (vpn-12-36.rdu.redhat.com [10.11.12.36]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n99I3JJE017374; Fri, 9 Oct 2009 14:03:30 -0400 From: Glauber Costa To: kvm@vger.kernel.org Cc: avi@redhat.com Subject: [PATCH 06/10] make some functions static Date: Fri, 9 Oct 2009 15:03:14 -0300 Message-Id: <1255111398-15251-7-git-send-email-glommer@redhat.com> In-Reply-To: <1255111398-15251-6-git-send-email-glommer@redhat.com> References: <1255111398-15251-1-git-send-email-glommer@redhat.com> <1255111398-15251-2-git-send-email-glommer@redhat.com> <1255111398-15251-3-git-send-email-glommer@redhat.com> <1255111398-15251-4-git-send-email-glommer@redhat.com> <1255111398-15251-5-git-send-email-glommer@redhat.com> <1255111398-15251-6-git-send-email-glommer@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 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 7546fcb..10bd530 100644 --- a/qemu-kvm-x86.c +++ b/qemu-kvm-x86.c @@ -538,19 +538,19 @@ void kvm_show_regs(kvm_vcpu_context_t vcpu) sregs.efer); } -uint64_t kvm_get_apic_base(kvm_vcpu_context_t vcpu) +static uint64_t kvm_get_apic_base(CPUState *env) { - return vcpu->run->apic_base; + return env->kvm_run->apic_base; } -void kvm_set_cr8(kvm_vcpu_context_t vcpu, uint64_t cr8) +static void kvm_set_cr8(CPUState *env, uint64_t cr8) { - vcpu->run->cr8 = cr8; + env->kvm_run->cr8 = cr8; } -__u64 kvm_get_cr8(kvm_vcpu_context_t vcpu) +static __u64 kvm_get_cr8(CPUState *env) { - return vcpu->run->cr8; + return env->kvm_run->cr8; } int kvm_setup_cpuid(kvm_vcpu_context_t vcpu, int nent, @@ -1372,7 +1372,7 @@ int kvm_arch_halt(kvm_vcpu_context_t vcpu) void kvm_arch_pre_kvm_run(void *opaque, CPUState *env) { if (!kvm_irqchip_in_kernel()) - kvm_set_cr8(env->kvm_cpu_state.vcpu_ctx, cpu_get_apic_tpr(env)); + kvm_set_cr8(env, cpu_get_apic_tpr(env)); } void kvm_arch_post_kvm_run(void *opaque, CPUState *env) @@ -1382,8 +1382,8 @@ void kvm_arch_post_kvm_run(void *opaque, CPUState *env) env->eflags = kvm_get_interrupt_flag(env->kvm_cpu_state.vcpu_ctx) ? env->eflags | IF_MASK : env->eflags & ~IF_MASK; - cpu_set_apic_tpr(env, kvm_get_cr8(env->kvm_cpu_state.vcpu_ctx)); - cpu_set_apic_base(env, kvm_get_apic_base(env->kvm_cpu_state.vcpu_ctx)); + cpu_set_apic_tpr(env, kvm_get_cr8(env)); + cpu_set_apic_base(env, kvm_get_apic_base(env)); } int kvm_arch_has_work(CPUState *env) diff --git a/qemu-kvm.h b/qemu-kvm.h index 3bc483e..1f23fe4 100644 --- a/qemu-kvm.h +++ b/qemu-kvm.h @@ -219,17 +219,6 @@ int kvm_run(kvm_vcpu_context_t vcpu, void *env); int kvm_get_interrupt_flag(kvm_vcpu_context_t vcpu); /*! - * \brief Get the value of the APIC_BASE msr as of last exit to userspace - * - * This gets the APIC_BASE msr 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 APIC_BASE msr contents - */ -uint64_t kvm_get_apic_base(kvm_vcpu_context_t vcpu); - -/*! * \brief Check if a vcpu is ready for interrupt injection * * This checks if vcpu interrupts are not masked by mov ss or sti. @@ -422,28 +411,6 @@ int kvm_set_shadow_pages(kvm_context_t kvm, unsigned int nrshadow_pages); */ int kvm_get_shadow_pages(kvm_context_t kvm, unsigned int *nrshadow_pages); -/*! - * \brief Set up cr8 for next time the vcpu is executed - * - * This is a fast setter for cr8, which will be applied when the - * vcpu next enters guest mode. - * - * \param kvm Pointer to the current kvm_context - * \param vcpu Which virtual CPU should get dumped - * \param cr8 next cr8 value - */ -void kvm_set_cr8(kvm_vcpu_context_t vcpu, uint64_t cr8); - -/*! - * \brief Get cr8 for sync tpr in qemu apic emulation - * - * This is a getter for cr8, which used to sync with the tpr in qemu - * apic emualtion. - * - * \param kvm Pointer to the current kvm_context - * \param vcpu Which virtual CPU should get dumped - */ -__u64 kvm_get_cr8(kvm_vcpu_context_t vcpu); #endif /*!