summaryrefslogtreecommitdiff
path: root/xen/arch/x86/acpi/cpufreq/cpufreq.c
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2010-04-09 08:52:43 +0100
committerKeir Fraser <keir.fraser@citrix.com>2010-04-09 08:52:43 +0100
commit002c5bcdbe112c70718ebc81ba95290210fa7f0d (patch)
tree79b6f996ecc5d1dd2d5f847acdf4525e4be768e2 /xen/arch/x86/acpi/cpufreq/cpufreq.c
parente136054cedf0b8d9395d35b8d3e5334eb514c47d (diff)
Refactor Xen Support for Intel Turbo Boost
Refactor the existing code that supports the Intel Turbo feature to move all the driver specific bits in the cpufreq driver. Create a tri-state interface for the Turbo feature that can distinguish amongst enabled Turbo, disabled Turbo, and processors that don't support Turbo at all. Signed-off-by: Mark Langsdorf <mark.langsdorf@amd.com>
Diffstat (limited to 'xen/arch/x86/acpi/cpufreq/cpufreq.c')
-rw-r--r--xen/arch/x86/acpi/cpufreq/cpufreq.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/xen/arch/x86/acpi/cpufreq/cpufreq.c b/xen/arch/x86/acpi/cpufreq/cpufreq.c
index 791cccd0d9..17776b4735 100644
--- a/xen/arch/x86/acpi/cpufreq/cpufreq.c
+++ b/xen/arch/x86/acpi/cpufreq/cpufreq.c
@@ -410,6 +410,10 @@ static int acpi_cpufreq_target(struct cpufreq_policy *policy,
return -ENODEV;
}
+ if (policy->turbo == CPUFREQ_TURBO_DISABLED)
+ if (target_freq > policy->cpuinfo.second_max_freq)
+ target_freq = policy->cpuinfo.second_max_freq;
+
perf = data->acpi_data;
result = cpufreq_frequency_table_target(policy,
data->freq_table,
@@ -610,12 +614,19 @@ acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
break;
}
- /* Check for APERF/MPERF support in hardware */
+ /* Check for APERF/MPERF support in hardware
+ * also check for boost support */
if (c->x86_vendor == X86_VENDOR_INTEL && c->cpuid_level >= 6) {
unsigned int ecx;
+ unsigned int eax;
ecx = cpuid_ecx(6);
if (ecx & CPUID_6_ECX_APERFMPERF_CAPABILITY)
acpi_cpufreq_driver.getavg = get_measured_perf;
+ eax = cpuid_eax(6);
+ if ( eax & 0x2 ) {
+ policy->turbo = CPUFREQ_TURBO_ENABLED;
+ printk(XENLOG_INFO "Turbo Mode detected and enabled!\n");
+ }
}
/*