From patchwork Tue Jun 1 12:33:45 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avi Kivity X-Patchwork-Id: 103529 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 o51CY1bT008578 for ; Tue, 1 Jun 2010 12:34:02 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756341Ab0FAMdx (ORCPT ); Tue, 1 Jun 2010 08:33:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:28807 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755710Ab0FAMdt (ORCPT ); Tue, 1 Jun 2010 08:33:49 -0400 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o51CXnmT019667 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 1 Jun 2010 08:33:49 -0400 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o51CXm3W029389 for ; Tue, 1 Jun 2010 08:33:48 -0400 Received: from file.tlv.redhat.com (file.tlv.redhat.com [10.35.255.8]) by cleopatra.tlv.redhat.com (Postfix) with ESMTP id 0F347250ADA; Tue, 1 Jun 2010 15:33:48 +0300 (IDT) From: Avi Kivity To: Marcelo Tosatti , Glauber Costa Cc: kvm@vger.kernel.org Subject: [PATCH 3/5] Rename kvm_arch_vcpu_init()s cenv argument to env Date: Tue, 1 Jun 2010 15:33:45 +0300 Message-Id: <1275395627-2321-4-git-send-email-avi@redhat.com> In-Reply-To: <1275395627-2321-1-git-send-email-avi@redhat.com> References: <1275395627-2321-1-git-send-email-avi@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.18 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, 01 Jun 2010 12:34:02 +0000 (UTC) diff --git a/qemu-kvm-x86.c b/qemu-kvm-x86.c index 3b9be6d..f5c76bc 100644 --- a/qemu-kvm-x86.c +++ b/qemu-kvm-x86.c @@ -1129,7 +1129,7 @@ static void kvm_trim_features(uint32_t *features, uint32_t supported) } } -int kvm_arch_init_vcpu(CPUState *cenv) +int kvm_arch_init_vcpu(CPUState *env) { struct kvm_cpuid_entry2 cpuid_ent[100]; #ifdef KVM_CPUID_SIGNATURE @@ -1140,7 +1140,7 @@ int kvm_arch_init_vcpu(CPUState *cenv) CPUState copy; uint32_t i, j, limit; - kvm_arch_reset_vcpu(cenv); + kvm_arch_reset_vcpu(env); #ifdef KVM_CPUID_SIGNATURE /* Paravirtualization CPUIDs */ @@ -1156,24 +1156,24 @@ int kvm_arch_init_vcpu(CPUState *cenv) pv_ent = &cpuid_ent[cpuid_nent++]; memset(pv_ent, 0, sizeof(*pv_ent)); pv_ent->function = KVM_CPUID_FEATURES; - pv_ent->eax = get_para_features(cenv); + pv_ent->eax = get_para_features(env); #endif - kvm_trim_features(&cenv->cpuid_features, - kvm_arch_get_supported_cpuid(cenv, 1, R_EDX)); + kvm_trim_features(&env->cpuid_features, + kvm_arch_get_supported_cpuid(env, 1, R_EDX)); /* prevent the hypervisor bit from being cleared by the kernel */ - i = cenv->cpuid_ext_features & CPUID_EXT_HYPERVISOR; - kvm_trim_features(&cenv->cpuid_ext_features, - kvm_arch_get_supported_cpuid(cenv, 1, R_ECX)); - cenv->cpuid_ext_features |= i; + i = env->cpuid_ext_features & CPUID_EXT_HYPERVISOR; + kvm_trim_features(&env->cpuid_ext_features, + kvm_arch_get_supported_cpuid(env, 1, R_ECX)); + env->cpuid_ext_features |= i; - kvm_trim_features(&cenv->cpuid_ext2_features, - kvm_arch_get_supported_cpuid(cenv, 0x80000001, R_EDX)); - kvm_trim_features(&cenv->cpuid_ext3_features, - kvm_arch_get_supported_cpuid(cenv, 0x80000001, R_ECX)); + kvm_trim_features(&env->cpuid_ext2_features, + kvm_arch_get_supported_cpuid(env, 0x80000001, R_EDX)); + kvm_trim_features(&env->cpuid_ext3_features, + kvm_arch_get_supported_cpuid(env, 0x80000001, R_ECX)); - copy = *cenv; + copy = *env; copy.regs[R_EAX] = 0; qemu_kvm_cpuid_on_env(©); @@ -1207,11 +1207,11 @@ int kvm_arch_init_vcpu(CPUState *cenv) for (i = 0x80000000; i <= limit; ++i) do_cpuid_ent(&cpuid_ent[cpuid_nent++], i, 0, ©); - kvm_setup_cpuid2(cenv, cpuid_nent, cpuid_ent); + kvm_setup_cpuid2(env, cpuid_nent, cpuid_ent); #ifdef KVM_CAP_MCE - if (((cenv->cpuid_version >> 8)&0xF) >= 6 - && (cenv->cpuid_features&(CPUID_MCE|CPUID_MCA)) == (CPUID_MCE|CPUID_MCA) + if (((env->cpuid_version >> 8)&0xF) >= 6 + && (env->cpuid_features&(CPUID_MCE|CPUID_MCA)) == (CPUID_MCE|CPUID_MCA) && kvm_check_extension(kvm_state, KVM_CAP_MCE) > 0) { uint64_t mcg_cap; int banks; @@ -1223,18 +1223,18 @@ int kvm_arch_init_vcpu(CPUState *cenv) banks = MCE_BANKS_DEF; mcg_cap &= MCE_CAP_DEF; mcg_cap |= banks; - if (kvm_setup_mce(cenv, &mcg_cap)) + if (kvm_setup_mce(env, &mcg_cap)) perror("kvm_setup_mce FAILED"); else - cenv->mcg_cap = mcg_cap; + env->mcg_cap = mcg_cap; } } #endif #ifdef KVM_EXIT_TPR_ACCESS - kvm_enable_tpr_access_reporting(cenv); + kvm_enable_tpr_access_reporting(env); #endif - kvm_reset_mpstate(cenv); + kvm_reset_mpstate(env); return 0; }