public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Marcelo Tosatti <mtosatti@redhat.com>,
	Joerg Roedel <joerg.roedel@amd.com>
Cc: Avi Kivity <avi@redhat.com>, kvm@vger.kernel.org, qemu-devel@nongnu.org
Subject: Re: [PATCH 3/3] qemu-x86: Set tsc_khz in kvm when supported
Date: Tue, 19 Jul 2011 19:03:34 +0200	[thread overview]
Message-ID: <4E25B8E6.5050705@siemens.com> (raw)
In-Reply-To: <20110719114856.GB28500@amt.cnet>

On 2011-07-19 13:48, Marcelo Tosatti wrote:
> On Thu, Jul 07, 2011 at 04:13:13PM +0200, Joerg Roedel wrote:
>> Make use of the KVM_TSC_CONTROL feature if available.
>>
>> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
>> ---
>>  target-i386/kvm.c |   18 +++++++++++++++++-
>>  1 files changed, 17 insertions(+), 1 deletions(-)
>>
>> diff --git a/target-i386/kvm.c b/target-i386/kvm.c
>> index 10fb2c4..923d2d5 100644
>> --- a/target-i386/kvm.c
>> +++ b/target-i386/kvm.c
>> @@ -354,6 +354,7 @@ int kvm_arch_init_vcpu(CPUState *env)
>>      uint32_t unused;
>>      struct kvm_cpuid_entry2 *c;
>>      uint32_t signature[3];
>> +    int r;
>>  
>>      env->cpuid_features &= kvm_arch_get_supported_cpuid(s, 1, 0, R_EDX);
>>  
>> @@ -499,7 +500,22 @@ int kvm_arch_init_vcpu(CPUState *env)
>>  
>>      qemu_add_vm_change_state_handler(cpu_update_state, env);
>>  
>> -    return kvm_vcpu_ioctl(env, KVM_SET_CPUID2, &cpuid_data);
>> +    r = kvm_vcpu_ioctl(env, KVM_SET_CPUID2, &cpuid_data);
>> +    if (r)
>> +	    return r;
>> +
>> +#ifdef KVM_CAP_TSC_CONTROL
>> +    r = kvm_check_extension(env->kvm_state, KVM_CAP_TSC_CONTROL);
>> +    if (r && env->tsc_khz) {
>> +        r = kvm_vcpu_ioctl(env, KVM_SET_TSC_KHZ, env->tsc_khz);
>> +        if (r < 0) {
>> +            fprintf(stderr, "KVM_SET_TSC_KHZ failed\n");
>> +            return r;
>> +        }
>> +    }
>> +#endif
> 

#ifdef times are over, please clean up before pushing upstream.

Jan

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux

  reply	other threads:[~2011-07-19 17:03 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-07 14:13 [PATCH 0/3][uq/master] Basic TSC-Scaling support v2 Joerg Roedel
2011-07-07 14:13 ` [PATCH 1/3] qemu: Add strtosz_suffix_unit function Joerg Roedel
2011-07-08  8:00   ` Markus Armbruster
2011-07-07 14:13 ` [PATCH 2/3] qemu-x86: Add tsc_freq option to -cpu Joerg Roedel
2011-07-19 11:46   ` Marcelo Tosatti
2011-07-19 12:20     ` Avi Kivity
2011-07-19 12:56       ` Marcelo Tosatti
2011-07-19 13:30       ` Joerg Roedel
2011-07-19 13:54         ` Avi Kivity
2011-07-19 13:55           ` Avi Kivity
2011-07-19 14:14             ` Joerg Roedel
2011-07-19 15:55               ` Avi Kivity
2011-07-07 14:13 ` [PATCH 3/3] qemu-x86: Set tsc_khz in kvm when supported Joerg Roedel
2011-07-19 11:48   ` Marcelo Tosatti
2011-07-19 17:03     ` Jan Kiszka [this message]
2011-07-19 13:04 ` [PATCH 0/3][uq/master] Basic TSC-Scaling support v2 Marcelo Tosatti

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=4E25B8E6.5050705@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=avi@redhat.com \
    --cc=joerg.roedel@amd.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=qemu-devel@nongnu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox