From patchwork Tue Mar 9 00:47:11 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Tosatti X-Patchwork-Id: 84198 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 o290o4au020711 for ; Tue, 9 Mar 2010 00:50:05 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756279Ab0CIAtq (ORCPT ); Mon, 8 Mar 2010 19:49:46 -0500 Received: from mx1.redhat.com ([209.132.183.28]:7636 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756237Ab0CIAta (ORCPT ); Mon, 8 Mar 2010 19:49:30 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o290nU5R001966 (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-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o290nT0r030865; Mon, 8 Mar 2010 19:49:29 -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 o290nSRF000985; 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 5272F68A868; Mon, 8 Mar 2010 21:48:55 -0300 (BRT) Received: (from marcelo@localhost) by amt.cnet (8.14.3/8.14.3/Submit) id o290mnEZ019711; Mon, 8 Mar 2010 21:48:49 -0300 Message-Id: <20100309004834.908684791@redhat.com> User-Agent: quilt/0.47-1 Date: Mon, 08 Mar 2010 21:47:11 -0300 From: Marcelo Tosatti To: kvm@vger.kernel.org Cc: Marcelo Tosatti Subject: [patch 7/7] kvm-tpr-opt: rename env->update_vapic References: <20100309004704.049355766@redhat.com> Content-Disposition: inline; filename=rename-update-vapic X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 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/kvm-tpr-opt.c =================================================================== --- qemu-kvm-tpr.orig/kvm-tpr-opt.c +++ qemu-kvm-tpr/kvm-tpr-opt.c @@ -226,17 +226,11 @@ int kvm_tpr_enable_vapic(CPUState *env) kvm_enable_vapic(env, vapic_phys + (pcr_cpu << 7)); cpu_physical_memory_rw(vapic_phys + (pcr_cpu << 7) + 4, &one, 1, 1); - env->update_vapic = 0; + env->kvm_vcpu_update_vapic = 0; bios_enabled = 1; return 1; } -static int enable_vapic(CPUState *env) -{ - env->update_vapic = 1; - return 1; -} - static void patch_call(CPUState *env, uint64_t rip, uint32_t target) { uint32_t offset; @@ -334,7 +328,7 @@ static int tpr_load(QEMUFile *f, void *s CPUState *env = first_cpu->next_cpu; for (env = first_cpu; env != NULL; env = env->next_cpu) - enable_vapic(env); + env->kvm_vcpu_update_vapic = 1; } return 0; Index: qemu-kvm-tpr/qemu-kvm-x86.c =================================================================== --- qemu-kvm-tpr.orig/qemu-kvm-x86.c +++ qemu-kvm-tpr/qemu-kvm-x86.c @@ -971,7 +971,7 @@ void kvm_arch_load_regs(CPUState *env, i kvm_load_lapic(env); } if (level == KVM_PUT_FULL_STATE) { - if (env->update_vapic) + if (env->kvm_vcpu_update_vapic) kvm_tpr_enable_vapic(env); } if (kvm_irqchip_in_kernel()) { Index: qemu-kvm-tpr/target-i386/cpu.h =================================================================== --- qemu-kvm-tpr.orig/target-i386/cpu.h +++ qemu-kvm-tpr/target-i386/cpu.h @@ -735,7 +735,7 @@ typedef struct CPUX86State { uint16_t fptag_vmstate; uint16_t fpregs_format_vmstate; - int update_vapic; + int kvm_vcpu_update_vapic; } CPUX86State; CPUX86State *cpu_x86_init(const char *cpu_model);