qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Denis V. Lunev" <den@openvz.org>, qemu-devel@nongnu.org
Cc: Evgeny Yakovlev <eyakovlev@virtuozzo.com>,
	Richard Henderson <rth@twiddle.net>,
	Eduardo Habkost <ehabkost@redhat.com>,
	Marcelo Tosatti <mtosatti@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2 1/1] cpu: report hyperv feature words through qom
Date: Tue, 21 Jun 2016 14:00:22 +0200	[thread overview]
Message-ID: <c005739d-0335-c601-1c05-febadd37f192@redhat.com> (raw)
In-Reply-To: <1466436580-1309-1-git-send-email-den@openvz.org>

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

  reply	other threads:[~2016-06-21 12:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-20 15:29 [Qemu-devel] [PATCH v2 1/1] cpu: report hyperv feature words through qom Denis V. Lunev
2016-06-21 12:00 ` Paolo Bonzini [this message]
2016-06-22 21:05   ` Eduardo Habkost
2016-06-22 21:01 ` Eduardo Habkost
2016-06-24 10:10   ` Evgeny Yakovlev
2016-06-24 13:15     ` Eduardo Habkost

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c005739d-0335-c601-1c05-febadd37f192@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=den@openvz.org \
    --cc=ehabkost@redhat.com \
    --cc=eyakovlev@virtuozzo.com \
    --cc=mtosatti@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).