From: tip-bot for Huang Rui <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: fengguang.wu@intel.com, alexander.shishkin@linux.intel.com,
fweisbec@gmail.com, luto@amacapital.net, Vincent.Wan@amd.com,
hecmargi@upv.es, kristen@linux.intel.com,
suravee.suthikulpanit@amd.com, bp@suse.de, dvlasenk@redhat.com,
peterz@infradead.org, ross.zwisler@linux.intel.com,
ray.huang@amd.com, brgerst@gmail.com, john.stultz@linaro.org,
acme@redhat.com, aaron.lu@intel.com, tglx@linutronix.de,
Aravind.Gopalakrishnan@amd.com, dsahern@gmail.com,
rric@kernel.org, vincent.weaver@maine.edu, jolsa@redhat.com,
luto@kernel.org, linux@roeck-us.net, jacob.w.shin@gmail.com,
eranian@google.com, hpa@zytor.com, namhyung@kernel.org,
mingo@kernel.org, bp@alien8.de, herrmann.der.user@googlemail.com,
torvalds@linux-foundation.org, linux-kernel@vger.kernel.org
Subject: [tip:perf/urgent] x86/cpufeature, perf/x86: Add AMD Accumulated Power Mechanism feature flag
Date: Mon, 21 Mar 2016 02:55:26 -0700 [thread overview]
Message-ID: <tip-01fe03ff1c7ce6b6e2212cb6171a49c2858fbc7c@git.kernel.org> (raw)
In-Reply-To: <1452739808-11871-4-git-send-email-ray.huang@amd.com>
Commit-ID: 01fe03ff1c7ce6b6e2212cb6171a49c2858fbc7c
Gitweb: http://git.kernel.org/tip/01fe03ff1c7ce6b6e2212cb6171a49c2858fbc7c
Author: Huang Rui <ray.huang@amd.com>
AuthorDate: Thu, 14 Jan 2016 10:50:06 +0800
Committer: Ingo Molnar <mingo@kernel.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@amd.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Aaron Lu <aaron.lu@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andreas Herrmann <herrmann.der.user@googlemail.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Fengguang Wu <fengguang.wu@intel.com>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Hector Marco-Gisbert <hecmargi@upv.es>
Cc: Jacob Shin <jacob.w.shin@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Kristen Carlson Accardi <kristen@linux.intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Robert Richter <rric@kernel.org>
Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Cc: Wan Zongshun <Vincent.Wan@amd.com>
Cc: spg_linux_kernel@amd.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@kernel.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
next prev parent reply other threads:[~2016-03-21 10:01 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-14 2:50 [PATCH v2 0/5] perf/x86/power: Introduce AMD accumlated power reporting mechanism Huang Rui
2016-01-14 2:50 ` [PATCH v2 1/5] x86/amd: move nodes_per_socket into bsp_init_amd Huang Rui
2016-03-21 9:54 ` [tip:perf/urgent] perf/x86/amd: Move nodes_per_socket into bsp_init_amd() tip-bot for Huang Rui
2016-01-14 2:50 ` [PATCH v2 2/5] x86/amd: add accessor for number of cores per compute unit Huang Rui
2016-01-14 2:50 ` [PATCH v2 3/5] x86/cpufeature: add AMD Accumulated Power Mechanism feature flag Huang Rui
2016-03-21 9:55 ` tip-bot for Huang Rui [this message]
2016-01-14 2:50 ` [PATCH v2 4/5] perf/x86: Move events_sysfs_show outside CPU_SUP_INTEL Huang Rui
2016-01-14 2:50 ` [PATCH v2 5/5] perf/x86/amd/power: Add AMD accumulated power reporting mechanism Huang Rui
2016-01-19 12:12 ` Peter Zijlstra
2016-01-20 4:48 ` Huang Rui
2016-01-20 9:22 ` Peter Zijlstra
2016-01-21 7:04 ` Huang Rui
2016-01-21 9:02 ` Peter Zijlstra
2016-01-21 14:42 ` Huang Rui
2016-01-21 15:10 ` Peter Zijlstra
2016-01-21 15:24 ` Huang Rui
2016-01-21 15:51 ` Peter Zijlstra
2016-01-21 16:59 ` Borislav Petkov
2016-01-22 8:04 ` Huang Rui
2016-01-22 17:51 ` Borislav Petkov
2016-01-14 6:01 ` [PATCH v2 0/5] perf/x86/power: Introduce AMD accumlated " Borislav Petkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-01fe03ff1c7ce6b6e2212cb6171a49c2858fbc7c@git.kernel.org \
--to=tipbot@zytor.com \
--cc=Aravind.Gopalakrishnan@amd.com \
--cc=Vincent.Wan@amd.com \
--cc=aaron.lu@intel.com \
--cc=acme@redhat.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=bp@alien8.de \
--cc=bp@suse.de \
--cc=brgerst@gmail.com \
--cc=dsahern@gmail.com \
--cc=dvlasenk@redhat.com \
--cc=eranian@google.com \
--cc=fengguang.wu@intel.com \
--cc=fweisbec@gmail.com \
--cc=hecmargi@upv.es \
--cc=herrmann.der.user@googlemail.com \
--cc=hpa@zytor.com \
--cc=jacob.w.shin@gmail.com \
--cc=john.stultz@linaro.org \
--cc=jolsa@redhat.com \
--cc=kristen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=luto@amacapital.net \
--cc=luto@kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=ray.huang@amd.com \
--cc=ross.zwisler@linux.intel.com \
--cc=rric@kernel.org \
--cc=suravee.suthikulpanit@amd.com \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=vincent.weaver@maine.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome