Received: from eggs.gnu.org ([2001:4830:134:3::10]:55518) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1boykc-0003qL-6k for qemu-devel@nongnu.org; Tue, 27 Sep 2016 16:13:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1boyka-0007RH-Ba for qemu-devel@nongnu.org; Tue, 27 Sep 2016 16:13:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59924) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1boyka-0007Qn-54 for qemu-devel@nongnu.org; Tue, 27 Sep 2016 16:13:12 -0400 From: Eduardo Habkost Date: Tue, 27 Sep 2016 17:12:26 -0300 Message-Id: <1475007150-14665-17-git-send-email-ehabkost@redhat.com> In-Reply-To: <1475007150-14665-1-git-send-email-ehabkost@redhat.com> References: <1475007150-14665-1-git-send-email-ehabkost@redhat.com> Subject: [Qemu-devel] [PULL 16/20] target-i386: Remove has_msr_hv_apic global variable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Paolo Bonzini , Richard Henderson , qemu-devel@nongnu.org The global variable is not necessary because we can check cpu->hyperv_vapic directly. Reviewed-by: Paolo Bonzini Signed-off-by: Eduardo Habkost --- target-i386/kvm.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/target-i386/kvm.c b/target-i386/kvm.c index 5118562..031ae90 100644 --- a/target-i386/kvm.c +++ b/target-i386/kvm.c @@ -91,7 +91,6 @@ static bool has_msr_bndcfgs; static bool has_msr_kvm_steal_time; static int lm_capable_kernel; static bool has_msr_hv_hypercall; -static bool has_msr_hv_vapic; static bool has_msr_hv_tsc; static bool has_msr_hv_crash; static bool has_msr_hv_reset; @@ -609,7 +608,6 @@ static int hyperv_handle_properties(CPUState *cs) if (cpu->hyperv_vapic) { env->features[FEAT_HYPERV_EAX] |= HV_X64_MSR_HYPERCALL_AVAILABLE; env->features[FEAT_HYPERV_EAX] |= HV_X64_MSR_APIC_ACCESS_AVAILABLE; - has_msr_hv_vapic = true; } if (cpu->hyperv_time && kvm_check_extension(cs->kvm_state, KVM_CAP_HYPERV_TIME) > 0) { @@ -728,7 +726,7 @@ int kvm_arch_init_vcpu(CPUState *cs) if (cpu->hyperv_relaxed_timing) { c->eax |= HV_X64_RELAXED_TIMING_RECOMMENDED; } - if (has_msr_hv_vapic) { + if (cpu->hyperv_vapic) { c->eax |= HV_X64_APIC_ACCESS_RECOMMENDED; } c->ebx = cpu->hyperv_spinlock_attempts; @@ -1681,7 +1679,7 @@ static int kvm_put_msrs(X86CPU *cpu, int level) kvm_msr_entry_add(cpu, HV_X64_MSR_HYPERCALL, env->msr_hv_hypercall); } - if (has_msr_hv_vapic) { + if (cpu->hyperv_vapic) { kvm_msr_entry_add(cpu, HV_X64_MSR_APIC_ASSIST_PAGE, env->msr_hv_vapic); } @@ -2086,7 +2084,7 @@ static int kvm_get_msrs(X86CPU *cpu) kvm_msr_entry_add(cpu, HV_X64_MSR_HYPERCALL, 0); kvm_msr_entry_add(cpu, HV_X64_MSR_GUEST_OS_ID, 0); } - if (has_msr_hv_vapic) { + if (cpu->hyperv_vapic) { kvm_msr_entry_add(cpu, HV_X64_MSR_APIC_ASSIST_PAGE, 0); } if (has_msr_hv_tsc) { -- 2.7.4