From patchwork Tue Mar 9 00:47:05 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Tosatti X-Patchwork-Id: 84197 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o290o4at020711 for ; Tue, 9 Mar 2010 00:50:04 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756277Ab0CIAtp (ORCPT ); Mon, 8 Mar 2010 19:49:45 -0500 Received: from mx1.redhat.com ([209.132.183.28]:63761 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756235Ab0CIAta (ORCPT ); Mon, 8 Mar 2010 19:49:30 -0500 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o290nUIG019819 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 8 Mar 2010 19:49:30 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o290nT2A024260; Mon, 8 Mar 2010 19:49:30 -0500 Received: from amt.cnet (vpn-9-132.rdu.redhat.com [10.11.9.132]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o290nRFO000984; Mon, 8 Mar 2010 19:49:29 -0500 Received: from amt.cnet (amt.cnet [127.0.0.1]) by amt.cnet (Postfix) with ESMTP id 555D268A7D5; Mon, 8 Mar 2010 21:48:39 -0300 (BRT) Received: (from marcelo@localhost) by amt.cnet (8.14.3/8.14.3/Submit) id o290mc56019703; Mon, 8 Mar 2010 21:48:38 -0300 Message-Id: <20100309004834.539295724@redhat.com> User-Agent: quilt/0.47-1 Date: Mon, 08 Mar 2010 21:47:05 -0300 From: Marcelo Tosatti To: kvm@vger.kernel.org Cc: Marcelo Tosatti Subject: [patch 1/7] qemu-kvm: move vapic enablement to kvm_arch_load_regs References: <20100309004704.049355766@redhat.com> Content-Disposition: inline; filename=move-update-vapic-to-load-regs X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 09 Mar 2010 00:50:05 +0000 (UTC) Index: qemu-kvm-tpr/qemu-kvm-x86.c =================================================================== --- qemu-kvm-tpr.orig/qemu-kvm-x86.c +++ qemu-kvm-tpr/qemu-kvm-x86.c @@ -988,6 +988,10 @@ void kvm_arch_load_regs(CPUState *env, i kvm_arch_load_mpstate(env); kvm_load_lapic(env); } + if (level == KVM_PUT_FULL_STATE) { + if (env->update_vapic) + kvm_tpr_enable_vapic(env); + } if (kvm_irqchip_in_kernel()) { /* Avoid deadlock: no user space IRQ will ever clear it. */ env->halted = 0; @@ -1338,9 +1342,6 @@ int kvm_arch_halt(CPUState *env) int kvm_arch_pre_run(CPUState *env, struct kvm_run *run) { - if (env->update_vapic) { - kvm_tpr_enable_vapic(env); - } if (!kvm_irqchip_in_kernel()) kvm_set_cr8(env, cpu_get_apic_tpr(env)); return 0;