[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-01fe03ff1c7ce6b6e2212cb6171a49c2858fbc7c@git.kernel.org>
Date: Mon, 21 Mar 2016 02:55:26 -0700
From: tip-bot for Huang Rui <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: fengguang.wu@...el.com, alexander.shishkin@...ux.intel.com,
fweisbec@...il.com, luto@...capital.net, Vincent.Wan@....com,
hecmargi@....es, kristen@...ux.intel.com,
suravee.suthikulpanit@....com, bp@...e.de, dvlasenk@...hat.com,
peterz@...radead.org, ross.zwisler@...ux.intel.com,
ray.huang@....com, brgerst@...il.com, john.stultz@...aro.org,
acme@...hat.com, aaron.lu@...el.com, tglx@...utronix.de,
Aravind.Gopalakrishnan@....com, dsahern@...il.com, rric@...nel.org,
vincent.weaver@...ne.edu, jolsa@...hat.com, luto@...nel.org,
linux@...ck-us.net, jacob.w.shin@...il.com, eranian@...gle.com,
hpa@...or.com, namhyung@...nel.org, mingo@...nel.org, bp@...en8.de,
herrmann.der.user@...glemail.com, torvalds@...ux-foundation.org,
linux-kernel@...r.kernel.org
Subject: [tip:perf/urgent] x86/cpufeature, perf/x86: Add AMD Accumulated
Power Mechanism feature flag
Commit-ID: 01fe03ff1c7ce6b6e2212cb6171a49c2858fbc7c
Gitweb: http://git.kernel.org/tip/01fe03ff1c7ce6b6e2212cb6171a49c2858fbc7c
Author: Huang Rui <ray.huang@....com>
AuthorDate: Thu, 14 Jan 2016 10:50:06 +0800
Committer: Ingo Molnar <mingo@...nel.org>
CommitDate: Mon, 21 Mar 2016 09:35:29 +0100
x86/cpufeature, perf/x86: Add AMD Accumulated Power Mechanism feature flag
AMD CPU family 15h model 0x60 introduces a mechanism for measuring
accumulated power. It is used to report the processor power consumption
and support for it is indicated by CPUID Fn8000_0007_EDX[12].
Signed-off-by: Huang Rui <ray.huang@....com>
Signed-off-by: Borislav Petkov <bp@...e.de>
Cc: Aaron Lu <aaron.lu@...el.com>
Cc: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Cc: Andreas Herrmann <herrmann.der.user@...glemail.com>
Cc: Andy Lutomirski <luto@...capital.net>
Cc: Andy Lutomirski <luto@...nel.org>
Cc: Aravind Gopalakrishnan <Aravind.Gopalakrishnan@....com>
Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
Cc: Borislav Petkov <bp@...en8.de>
Cc: Brian Gerst <brgerst@...il.com>
Cc: David Ahern <dsahern@...il.com>
Cc: Denys Vlasenko <dvlasenk@...hat.com>
Cc: Fengguang Wu <fengguang.wu@...el.com>
Cc: Frédéric Weisbecker <fweisbec@...il.com>
Cc: Guenter Roeck <linux@...ck-us.net>
Cc: H. Peter Anvin <hpa@...or.com>
Cc: Hector Marco-Gisbert <hecmargi@....es>
Cc: Jacob Shin <jacob.w.shin@...il.com>
Cc: Jiri Olsa <jolsa@...hat.com>
Cc: John Stultz <john.stultz@...aro.org>
Cc: Kristen Carlson Accardi <kristen@...ux.intel.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Robert Richter <rric@...nel.org>
Cc: Ross Zwisler <ross.zwisler@...ux.intel.com>
Cc: Stephane Eranian <eranian@...gle.com>
Cc: Suravee Suthikulpanit <suravee.suthikulpanit@....com>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Vince Weaver <vincent.weaver@...ne.edu>
Cc: Wan Zongshun <Vincent.Wan@....com>
Cc: spg_linux_kernel@....com
Link: http://lkml.kernel.org/r/1452739808-11871-4-git-send-email-ray.huang@amd.com
[ Resolved conflict and moved the synthetic CPUID slot to 19. ]
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
arch/x86/include/asm/cpufeatures.h | 2 +-
arch/x86/kernel/cpu/amd.c | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h
index 746dd6a..44ebd04 100644
--- a/arch/x86/include/asm/cpufeatures.h
+++ b/arch/x86/include/asm/cpufeatures.h
@@ -94,7 +94,7 @@
#define X86_FEATURE_REP_GOOD ( 3*32+16) /* rep microcode works well */
#define X86_FEATURE_MFENCE_RDTSC ( 3*32+17) /* "" Mfence synchronizes RDTSC */
#define X86_FEATURE_LFENCE_RDTSC ( 3*32+18) /* "" Lfence synchronizes RDTSC */
-/* free, was #define X86_FEATURE_11AP ( 3*32+19) * "" Bad local APIC aka 11AP */
+#define X86_FEATURE_ACC_POWER ( 3*32+19) /* AMD Accumulated Power Mechanism */
#define X86_FEATURE_NOPL ( 3*32+20) /* The NOPL (0F 1F) instructions */
#define X86_FEATURE_ALWAYS ( 3*32+21) /* "" Always-present feature */
#define X86_FEATURE_XTOPOLOGY ( 3*32+22) /* cpu topology enum extensions */
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index d4b06e8..68fe8d3 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -546,6 +546,10 @@ static void early_init_amd(struct cpuinfo_x86 *c)
set_sched_clock_stable();
}
+ /* Bit 12 of 8000_0007 edx is accumulated power mechanism. */
+ if (c->x86_power & BIT(12))
+ set_cpu_cap(c, X86_FEATURE_ACC_POWER);
+
#ifdef CONFIG_X86_64
set_cpu_cap(c, X86_FEATURE_SYSCALL32);
#else
Powered by blists - more mailing lists