Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 261788
b: refs/heads/master
c: 029e9f7
h: refs/heads/master
v: v3
  • Loading branch information
Thomas Renninger authored and Dominik Brodowski committed Jul 29, 2011
1 parent e94e689 commit 40f9283
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 42 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8fb2e440b223b966f74a04a48f6f71f288fa671b
refs/heads/master: 029e9f73667f9b4661ac9886f706d75d26850260
6 changes: 6 additions & 0 deletions trunk/tools/power/cpupower/utils/helpers/cpuid.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@ int get_cpu_info(unsigned int cpu, struct cpupower_cpu_info *cpu_info)
cpu_info->caps |= CPUPOWER_CAP_AMD_CBP;
}

if (cpu_info->vendor == X86_VENDOR_INTEL) {
if (cpuid_level >= 6 &&
(cpuid_eax(6) & (1 << 1)))
cpu_info->caps |= CPUPOWER_CAP_INTEL_IDA;
}

if (cpu_info->vendor == X86_VENDOR_INTEL) {
/* Intel's perf-bias MSR support */
if (cpuid_level >= 6 && (cpuid_ecx(6) & (1 << 3)))
Expand Down
9 changes: 1 addition & 8 deletions trunk/tools/power/cpupower/utils/helpers/helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ enum cpupower_cpu_vendor {X86_VENDOR_UNKNOWN = 0, X86_VENDOR_INTEL,
#define CPUPOWER_CAP_PERF_BIAS 0x00000008
#define CPUPOWER_CAP_HAS_TURBO_RATIO 0x00000010
#define CPUPOWER_CAP_IS_SNB 0x00000011
#define CPUPOWER_CAP_INTEL_IDA 0x00000012

#define MAX_HW_PSTATES 10

Expand Down Expand Up @@ -115,9 +116,6 @@ extern int msr_intel_set_perf_bias(unsigned int cpu, unsigned int val);
extern int msr_intel_get_perf_bias(unsigned int cpu);
extern unsigned long long msr_intel_get_turbo_ratio(unsigned int cpu);

extern int msr_intel_has_boost_support(unsigned int cpu);
extern int msr_intel_boost_is_active(unsigned int cpu);

/* Read/Write msr ****************************/

/* PCI stuff ****************************/
Expand Down Expand Up @@ -163,11 +161,6 @@ static inline int msr_intel_get_perf_bias(unsigned int cpu)
static inline unsigned long long msr_intel_get_turbo_ratio(unsigned int cpu)
{ return 0; };

static inline int msr_intel_has_boost_support(unsigned int cpu)
{ return -1; };
static inline int msr_intel_boost_is_active(unsigned int cpu)
{ return -1; };

/* Read/Write msr ****************************/

static inline int cpufreq_has_boost_support(unsigned int cpu, int *support,
Expand Down
12 changes: 2 additions & 10 deletions trunk/tools/power/cpupower/utils/helpers/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,8 @@ int cpufreq_has_boost_support(unsigned int cpu, int *support, int *active,
if (ret <= 0)
return ret;
*support = 1;
} else if (cpupower_cpu_info.vendor == X86_VENDOR_INTEL) {
ret = msr_intel_has_boost_support(cpu);
if (ret <= 0)
return ret;
*support = ret;
ret = msr_intel_boost_is_active(cpu);
if (ret <= 0)
return ret;
*active = ret;
}
} else if (cpupower_cpu_info.caps & CPUPOWER_CAP_INTEL_IDA)
*support = *active = 1;
return 0;
}
#endif /* #if defined(__i386__) || defined(__x86_64__) */
23 changes: 0 additions & 23 deletions trunk/tools/power/cpupower/utils/helpers/msr.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,29 +72,6 @@ int write_msr(int cpu, unsigned int idx, unsigned long long val)
return -1;
}

int msr_intel_has_boost_support(unsigned int cpu)
{
unsigned long long misc_enables;
int ret;

ret = read_msr(cpu, MSR_IA32_MISC_ENABLES, &misc_enables);
if (ret)
return ret;

return (misc_enables >> 38) & 0x1;
}

int msr_intel_boost_is_active(unsigned int cpu)
{
unsigned long long perf_status;
int ret;

ret = read_msr(cpu, MSR_IA32_PERF_STATUS, &perf_status);
if (ret)
return ret;
return (perf_status >> 32) & 0x1;
}

int msr_intel_get_perf_bias(unsigned int cpu)
{
unsigned long long val;
Expand Down

0 comments on commit 40f9283

Please sign in to comment.