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:53:53 +0100
committerKeir Fraser <keir.fraser@citrix.com>2010-04-09 08:53:53 +0100
commit38c0598f9c61f5be0174657eea6fb0f689c40778 (patch)
tree3056ac98168ee33d9b73f3a5344ddce0609d4f68 /xen/arch/x86/acpi/cpufreq/cpufreq.c
parenta6adb8aa62960abf0722099bc527637bd068099e (diff)
Add support for AMD MPERF/APERF
Starting with Family 0x10, model 10 processors, some AMD processors will have support for the APERF/MPERF MSRs. This patch adds the checks necessary to support those MSRs. It also makes the get_measured_perf function defined inside cpufreq.c driver independent. max_freq is taken from the policy definition instead of being a private argument in struct acpi_cpufreq_data. The struct member is entirely removed from the function since it is no longer used. 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.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/xen/arch/x86/acpi/cpufreq/cpufreq.c b/xen/arch/x86/acpi/cpufreq/cpufreq.c
index 17776b4735..af591ee94f 100644
--- a/xen/arch/x86/acpi/cpufreq/cpufreq.c
+++ b/xen/arch/x86/acpi/cpufreq/cpufreq.c
@@ -269,7 +269,7 @@ static void read_measured_perf_ctrs(void *_readin)
* Only IA32_APERF/IA32_MPERF ratio is architecturally defined and
* no meaning should be associated with absolute values of these MSRs.
*/
-static unsigned int get_measured_perf(unsigned int cpu, unsigned int flag)
+unsigned int get_measured_perf(unsigned int cpu, unsigned int flag)
{
struct cpufreq_policy *policy;
struct perf_pair readin, cur, *saved;
@@ -353,7 +353,7 @@ static unsigned int get_measured_perf(unsigned int cpu, unsigned int flag)
#endif
- retval = drv_data[policy->cpu]->max_freq * perf_percent / 100;
+ retval = policy->cpuinfo.max_freq * perf_percent / 100;
return retval;
}
@@ -582,7 +582,6 @@ acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
policy->governor = cpufreq_opt_governor ? : CPUFREQ_DEFAULT_GOVERNOR;
- data->max_freq = perf->states[0].core_frequency * 1000;
/* table init */
for (i=0; i<perf->state_count; i++) {
if (i>0 && perf->states[i].core_frequency >=