[tip:x86/cpu] x86, cpu: Add AMD core boosting feature flag to /proc/cpuinfo

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: tip-bot for Borislav Petkov
Date: Friday, April 9, 2010 - 3:18 pm

Commit-ID:  5958f1d5d722df7a9e5d129676614a8e5219bacd
Gitweb:     http://git.kernel.org/tip/5958f1d5d722df7a9e5d129676614a8e5219bacd
Author:     Borislav Petkov <borislav.petkov@amd.com>
AuthorDate: Wed, 31 Mar 2010 21:56:41 +0200
Committer:  H. Peter Anvin <hpa@zytor.com>
CommitDate: Fri, 9 Apr 2010 14:05:23 -0700

x86, cpu: Add AMD core boosting feature flag to /proc/cpuinfo

By semi-popular demand, this adds the Core Performance Boost feature
flag to /proc/cpuinfo. Possible use case for this is userspace tools
like cpufreq-aperf, for example, so that they don't have to jump through
hoops of accessing "/dev/cpu/%d/cpuid" in order to check for CPB hw
support, or call cpuid from userspace.

Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
LKML-Reference: <1270065406-1814-2-git-send-email-bp@amd64.org>
Reviewed-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
---
 arch/x86/include/asm/cpufeature.h          |    1 +
 arch/x86/kernel/cpu/addon_cpuid_features.c |    5 +++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h
index 0cd82d0..630e623 100644
--- a/arch/x86/include/asm/cpufeature.h
+++ b/arch/x86/include/asm/cpufeature.h
@@ -161,6 +161,7 @@
  */
 #define X86_FEATURE_IDA		(7*32+ 0) /* Intel Dynamic Acceleration */
 #define X86_FEATURE_ARAT	(7*32+ 1) /* Always Running APIC Timer */
+#define X86_FEATURE_CPB		(7*32+ 2) /* AMD Core Performance Boost */
 
 /* Virtualization flags: Linux defined */
 #define X86_FEATURE_TPR_SHADOW  (8*32+ 0) /* Intel TPR Shadow */
diff --git a/arch/x86/kernel/cpu/addon_cpuid_features.c b/arch/x86/kernel/cpu/addon_cpuid_features.c
index 97ad79c..ead2a1c 100644
--- a/arch/x86/kernel/cpu/addon_cpuid_features.c
+++ b/arch/x86/kernel/cpu/addon_cpuid_features.c
@@ -30,8 +30,9 @@ void __cpuinit init_scattered_cpuid_features(struct cpuinfo_x86 *c)
 	const struct cpuid_bit *cb;
 
 	static const struct cpuid_bit __cpuinitconst cpuid_bits[] = {
-		{ X86_FEATURE_IDA, CR_EAX, 1, 0x00000006 },
-		{ X86_FEATURE_ARAT, CR_EAX, 2, 0x00000006 },
+		{ X86_FEATURE_IDA,   CR_EAX, 1, 0x00000006 },
+		{ X86_FEATURE_ARAT,  CR_EAX, 2, 0x00000006 },
+		{ X86_FEATURE_CPB,   CR_EDX, 9, 0x80000007 },
 		{ X86_FEATURE_NPT,   CR_EDX, 0, 0x8000000a },
 		{ X86_FEATURE_LBRV,  CR_EDX, 1, 0x8000000a },
 		{ X86_FEATURE_SVML,  CR_EDX, 2, 0x8000000a },
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 2/6] powernow-k8: Add core performance boost support, Borislav Petkov, (Wed Mar 31, 12:56 pm)
[PATCH 3/6] x86: Unify APERF/MPERF support, Borislav Petkov, (Wed Mar 31, 12:56 pm)
[PATCH 5/6] powernow-k8: Fix frequency reporting, Borislav Petkov, (Wed Mar 31, 12:56 pm)
[PATCH 6/6] cpufreq: Unify sysfs attribute definition macros, Borislav Petkov, (Wed Mar 31, 12:56 pm)
[tip:x86/cpu] x86, cpu: Add AMD core boosting feature flag ..., tip-bot for Borislav ..., (Fri Apr 9, 3:18 pm)
[tip:x86/cpu] powernow-k8: Add core performance boost support, tip-bot for Borislav ..., (Fri Apr 9, 3:19 pm)
[tip:x86/cpu] x86: Unify APERF/MPERF support, tip-bot for Borislav ..., (Fri Apr 9, 3:19 pm)
[tip:x86/cpu] x86, cpufreq: Add APERF/MPERF support for AM ..., tip-bot for Mark Lan ..., (Fri Apr 9, 3:19 pm)
[tip:x86/cpu] powernow-k8: Fix frequency reporting, tip-bot for Mark Lan ..., (Fri Apr 9, 3:19 pm)
[tip:x86/cpu] cpufreq: Unify sysfs attribute definition macros, tip-bot for Borislav ..., (Fri Apr 9, 3:20 pm)
[tip:x86/urgent] powernow-k8: Fix frequency reporting, tip-bot for Mark Lan ..., (Mon May 3, 6:09 am)
[tip:x86/cpu] x86, cpu: Make APERF/MPERF a normal table-dr ..., tip-bot for H. Peter ..., (Mon May 3, 4:21 pm)