From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50434) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFKM3-0004R2-9L for qemu-devel@nongnu.org; Tue, 21 Jun 2016 08:00:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bFKM0-0002k8-4X for qemu-devel@nongnu.org; Tue, 21 Jun 2016 08:00:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60387) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFKLz-0002jq-VP for qemu-devel@nongnu.org; Tue, 21 Jun 2016 08:00:28 -0400 References: <1466436580-1309-1-git-send-email-den@openvz.org> From: Paolo Bonzini Message-ID: Date: Tue, 21 Jun 2016 14:00:22 +0200 MIME-Version: 1.0 In-Reply-To: <1466436580-1309-1-git-send-email-den@openvz.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 1/1] cpu: report hyperv feature words through qom List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Denis V. Lunev" , qemu-devel@nongnu.org Cc: Evgeny Yakovlev , Richard Henderson , Eduardo Habkost , Marcelo Tosatti On 20/06/2016 17:29, Denis V. Lunev wrote: > +static int hyperv_handle_properties(CPUState *cs) > +{ > + X86CPU *cpu = X86_CPU(cs); > + CPUX86State *env = &cpu->env; > + > + if (cpu->hyperv_relaxed_timing) { > + env->features[FEAT_HYPERV_EAX] |= HV_X64_MSR_HYPERCALL_AVAILABLE; > + } > + 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) { > + env->features[FEAT_HYPERV_EAX] |= HV_X64_MSR_HYPERCALL_AVAILABLE; > + env->features[FEAT_HYPERV_EAX] |= HV_X64_MSR_TIME_REF_COUNT_AVAILABLE; > + env->features[FEAT_HYPERV_EAX] |= 0x200; > + has_msr_hv_tsc = true; > + } > + if (cpu->hyperv_crash && has_msr_hv_crash) { > + env->features[FEAT_HYPERV_EDX] |= HV_X64_GUEST_CRASH_MSR_AVAILABLE; > + } > + if (cpu->hyperv_reset && has_msr_hv_reset) { > + env->features[FEAT_HYPERV_EAX] |= HV_X64_MSR_RESET_AVAILABLE; > + } > + if (cpu->hyperv_vpindex && has_msr_hv_vpindex) { > + env->features[FEAT_HYPERV_EAX] |= HV_X64_MSR_VP_INDEX_AVAILABLE; > + } > + if (cpu->hyperv_runtime && has_msr_hv_runtime) { > + env->features[FEAT_HYPERV_EAX] |= HV_X64_MSR_VP_RUNTIME_AVAILABLE; Yay, thanks for this! I'm curious if there's anything more you need to support "-cpu ...,hv_time,enforce", and have it fail if KVM_CAP_HYPERV_TIME is not available. Thanks, Paolo