On Thu, Mar 24, 2011 at 12:04:13PM +0200, Avi Kivity wrote: > On 03/24/2011 09:40 AM, Joerg Roedel wrote: >> This patch implements the propagation of the VM >> virtual_tsc_khz into each vcpu data-structure to enable the >> tsc-scaling feature. >> static void svm_write_tsc_offset(struct kvm_vcpu *vcpu, u64 offset) >> { >> struct vcpu_svm *svm = to_svm(vcpu); >> @@ -1093,6 +1123,9 @@ static struct kvm_vcpu *svm_create_vcpu(struct kvm *kvm, unsigned int id) >> if (err) >> goto free_svm; >> >> + if (!svm_vcpu_init_tsc(kvm, svm)) >> + goto uninit; >> + > > Need to set err. > > I'm not really happy about failing on vcpu creation. Prefer to fail > when setting the frequency. Yes, in theory this shouldn't happen anyway because wrong frequencies are catched when setting them via the ioctl. This is just another check, but it should probably be turned into a BUG_ON in svm_vcpu_init_tsc() because it is a bug that userspace could set an invalid khz value. Joerg -- 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