On Wed, Jan 13, 2010 at 04:28:43PM +0200, Avi Kivity wrote: > 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. > It will still be {ret=val; break;}. 3 lines instead of one. -- Gleb. -- 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