From patchwork Mon Oct 19 13:29:25 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Glauber Costa X-Patchwork-Id: 54782 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 n9JDTTKv017788 for ; Mon, 19 Oct 2009 13:29:30 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755629AbZJSN3X (ORCPT ); Mon, 19 Oct 2009 09:29:23 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755934AbZJSN3X (ORCPT ); Mon, 19 Oct 2009 09:29:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:1763 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755618AbZJSN3X (ORCPT ); Mon, 19 Oct 2009 09:29:23 -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 n9JDTR2u021727 for ; Mon, 19 Oct 2009 09:29:28 -0400 Received: from localhost.localdomain (vpn-12-73.rdu.redhat.com [10.11.12.73]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n9JDTQmL031052; Mon, 19 Oct 2009 09:29:26 -0400 From: Glauber Costa To: kvm@vger.kernel.org Cc: avi@redhat.com Subject: [PATCH] move tpr stuff to qemu-kvm-x86.c Date: Mon, 19 Oct 2009 11:29:25 -0200 Message-Id: <1255958965-18471-1-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 db0b351..12da778 100644 --- a/qemu-kvm-x86.c +++ b/qemu-kvm-x86.c @@ -157,6 +157,10 @@ int kvm_arch_create(kvm_context_t kvm, unsigned long phys_mem_bytes, if (r < 0) return r; +#ifdef KVM_EXIT_TPR_ACCESS + kvm_tpr_opt_setup(); +#endif + return 0; } @@ -1305,6 +1309,9 @@ int kvm_arch_init_vcpu(CPUState *cenv) } #endif +#ifdef KVM_EXIT_TPR_ACCESS + kvm_tpr_vcpu_start(cenv); +#endif return 0; } diff --git a/qemu-kvm.c b/qemu-kvm.c index 57d8b1a..54cc12d 100644 --- a/qemu-kvm.c +++ b/qemu-kvm.c @@ -1865,9 +1865,6 @@ static int kvm_main_loop_cpu(CPUState *env) pthread_mutex_lock(&qemu_mutex); kvm_arch_init_vcpu(env); -#ifdef TARGET_I386 - kvm_tpr_vcpu_start(env); -#endif cpu_single_env = env; kvm_arch_load_regs(env); @@ -1960,9 +1957,6 @@ int kvm_init_ap(void) { struct sigaction action; -#ifdef TARGET_I386 - kvm_tpr_opt_setup(); -#endif qemu_add_vm_change_state_handler(kvm_vm_state_change_handler, NULL); signal(SIG_IPI, sig_ipi_handler);