Re: [PATCH 1/3] Implement bare minimum of HYPER-V MSRs.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 01/13/2010 04:26 PM, Gleb Natapov wrote:
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;}.


A break should suffice.

--
error compiling committee.c: too many arguments to function

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux