From: Bandan Das <bsd@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: kvm@vger.kernel.org, Gleb Natapov <gleb@redhat.com>,
Marcelo Tosatti <mtosatti@redhat.com>
Subject: Re: [PATCH v2 2/2] kvm: x86: emulate MSR_PLATFORM_INFO
Date: Tue, 18 Jun 2013 11:11:16 -0400 [thread overview]
Message-ID: <jpg7ghrmp2j.fsf@redhat.com> (raw)
In-Reply-To: <51C06994.1060807@redhat.com> (Paolo Bonzini's message of "Tue, 18 Jun 2013 16:07:16 +0200")
Paolo Bonzini <pbonzini@redhat.com> writes:
> Il 04/06/2013 18:02, Bandan Das ha scritto:
>> +static u64 kvm_get_platform_info(struct kvm_vcpu *vcpu)
>> +{
>> + u8 cpumodel;
>> + u32 bclk;
>> +
>> + /*
>> + * Programmable Ratio Limit for Turbo Mode (bit 28): 0
>> + * Programmable TDC-TDP Limit for Turbo Mode (bit 29): 0
>> + */
>> + u64 platform_info = 0, max_nonturbo_ratio = 0, max_effi_ratio = 0;
>> +
>> + cpumodel = kvm_cpuid_get_intel_model(vcpu);
>> +
>> + switch (cpumodel) {
>> + case MODEL_NEHALEM_CLARKSFIELD:
>> + case MODEL_NEHALEM_BLOOMFIELD:
>> + case MODEL_NEHALEM_EX:
>> + case MODEL_WESTMERE_ARRANDALE:
>> + case MODEL_WESTMERE_GULFTOWN:
>> + case MODEL_WESTMERE_EX:
>> + bclk = BCLK_133_DEFAULT;
>
> Just one change: please rename this to base_clock_khz and remove the
> BCLK_*_DEFAULT constants please.
Thanks for the review! I thought the base clock is usually referred to
as bclk in Intel parlance but not sure :)
Anyway, I will send a new one.
> Paolo
>
>> + break;
>> + case MODEL_SANDYBRIDGE_SANDY:
>> + case MODEL_SANDYBRIDGE_E:
>> + case MODEL_IVYBRIDGE_IVY:
>> + case MODEL_HASWELL_HASWELL:
>> + bclk = BCLK_100_DEFAULT;
>> + break;
>> + default:
>> + bclk = 0;
>> + break;
>> + }
>> +
>> + if (bclk) {
>> + max_nonturbo_ratio = max_effi_ratio
>> + = (u8)(vcpu->arch.virtual_tsc_khz / bclk);
>> + platform_info = (max_effi_ratio << 40)
>> + | (max_nonturbo_ratio << 8);
>> + }
next prev parent reply other threads:[~2013-06-18 15:11 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-04 16:02 [PATCH v2 0/2] kvm: x86: Emulate MSR_PLATFORM_INFO Bandan Das
2013-06-04 16:02 ` [PATCH v2 1/2] kvm: make vendor_intel a generic function Bandan Das
2013-06-04 23:33 ` Paolo Bonzini
2013-06-04 16:02 ` [PATCH v2 2/2] kvm: x86: emulate MSR_PLATFORM_INFO Bandan Das
2013-06-18 14:07 ` Paolo Bonzini
2013-06-18 15:11 ` Bandan Das [this message]
2013-06-05 8:42 ` [PATCH v2 0/2] kvm: x86: Emulate MSR_PLATFORM_INFO Gleb Natapov
2013-06-18 14:05 ` Paolo Bonzini
2013-06-18 15:16 ` Gleb Natapov
2013-06-18 15:29 ` Bandan Das
2013-06-18 15:40 ` Gleb Natapov
2013-06-19 17:50 ` Bandan Das
2013-06-20 7:31 ` Gleb Natapov
2013-06-20 8:34 ` Paolo Bonzini
2013-06-20 8:57 ` Gleb Natapov
2013-06-18 17:59 ` Nakajima, Jun
2013-06-19 10:57 ` Gleb Natapov
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=jpg7ghrmp2j.fsf@redhat.com \
--to=bsd@redhat.com \
--cc=gleb@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
--cc=pbonzini@redhat.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.