All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gleb Natapov <gleb@redhat.com>
To: Avi Kivity <avi@redhat.com>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH 1/3] Implement bare minimum of HYPER-V MSRs.
Date: Wed, 13 Jan 2010 16:26:46 +0200	[thread overview]
Message-ID: <20100113142646.GZ7549@redhat.com> (raw)
In-Reply-To: <4B4DD6ED.8060101@redhat.com>

On Wed, Jan 13, 2010 at 04:21:33PM +0200, Avi Kivity wrote:
> >  int kvm_set_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 data)
> >  {
> >  	switch (msr) {
> >@@ -1117,6 +1181,16 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 data)
> >  		pr_unimpl(vcpu, "unimplemented perfctr wrmsr: "
> >  			"0x%x data 0x%llx\n", msr, data);
> >  		break;
> >+	case HV_X64_MSR_GUEST_OS_ID ... HV_X64_MSR_SINT15:
> >+		if (kvm_hv_msr_partition_wide(msr)) {
> >+			int r;
> >+			mutex_lock(&vcpu->kvm->lock);
> >+			r = set_msr_hyperv_pw(vcpu, msr, data);
> >+			mutex_unlock(&vcpu->kvm->lock);
> 
> We do have locking.  Any reason not to put it in set_msr_hyperv_pw?
> Seems cleaner.
> 
Actually the way I did it looks cleaner to me. If locking is done inside
set_msr_hyperv_pw() then each simple "return" statement there will have
to be changed into {ret=val; goto unlock;}.

--
			Gleb.

  reply	other threads:[~2010-01-13 14:26 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-13 13:59 [PATCH 0/3] Add support for some HYPER-V PV features Gleb Natapov
2010-01-13 13:59 ` [PATCH 1/3] Implement bare minimum of HYPER-V MSRs Gleb Natapov
2010-01-13 14:21   ` Avi Kivity
2010-01-13 14:26     ` Gleb Natapov [this message]
2010-01-13 14:28       ` Avi Kivity
2010-01-13 14:31         ` Gleb Natapov
2010-01-13 13:59 ` [PATCH 2/3] Add HYPER-V apic access MSRs Gleb Natapov
2010-01-13 14:27   ` Anthony Liguori
2010-01-13 14:30     ` Gleb Natapov
2010-01-13 14:27   ` Avi Kivity
2010-01-13 14:40     ` Gleb Natapov
2010-01-13 14:57       ` Avi Kivity
2010-01-13 13:59 ` [PATCH 3/3] Implement NotifyLongSpinWait HYPER-V hypercall Gleb Natapov

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=20100113142646.GZ7549@redhat.com \
    --to=gleb@redhat.com \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.