Re: [PATCH v2 2/2] kvm: x86: emulate MSR_PLATFORM_INFO

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Paolo Bonzini <pbonzini@xxxxxxxxxx> 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);
>> +	}
--
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




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux