From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 4/6] KVM: SVM: Propagate requested TSC frequency on vcpu init Date: Thu, 24 Mar 2011 12:04:13 +0200 Message-ID: <4D8B171D.8080408@redhat.com> References: <1300952424-32014-1-git-send-email-joerg.roedel@amd.com> <1300952424-32014-5-git-send-email-joerg.roedel@amd.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Marcelo Tosatti , Zachary Amsden , kvm@vger.kernel.org To: Joerg Roedel Return-path: Received: from mx1.redhat.com ([209.132.183.28]:40629 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754687Ab1CXKET (ORCPT ); Thu, 24 Mar 2011 06:04:19 -0400 In-Reply-To: <1300952424-32014-5-git-send-email-joerg.roedel@amd.com> Sender: kvm-owner@vger.kernel.org List-ID: 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. Another issue is that we fail when the frequency is out of range, but not when it's wierd enough so we lose a lot of accuracy. I guess it won't matter in practice. -- error compiling committee.c: too many arguments to function