aboutsummaryrefslogtreecommitdiffstats
path: root/tools/power/cpupower/utils/helpers/helpers.h
diff options
context:
space:
mode:
authorJanakarajan Natarajan <Janakarajan.Natarajan@amd.com>2019-11-05 17:16:55 +0000
committerShuah Khan <skhan@linuxfoundation.org>2019-11-05 17:22:56 -0700
commit6af2ed53f0402c09b36d2b38698e18a25ca732a7 (patch)
treeea83341eecb9c5b048929e9aa75abf140ae48a3c /tools/power/cpupower/utils/helpers/helpers.h
parentcpupower: mperf_monitor: Introduce per_cpu_schedule flag (diff)
downloadlinux-dev-6af2ed53f0402c09b36d2b38698e18a25ca732a7.tar.xz
linux-dev-6af2ed53f0402c09b36d2b38698e18a25ca732a7.zip
cpupower: mperf_monitor: Update cpupower to use the RDPRU instruction
AMD Zen 2 introduces the RDPRU instruction which can be used to access some processor registers which are typically only accessible in privilege level 0. ECX specifies the register to read and EDX:EAX will contain the value read. ECX: 0 - Register MPERF 1 - Register APERF This has the added advantage of not having to use the msr module, since the userspace to kernel transitions which occur during each read_msr() might cause APERF and MPERF to go out of sync. Signed-off-by: Janakarajan Natarajan <Janakarajan.Natarajan@amd.com> Acked-by: Thomas Renninger <trenn@suse.de> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'tools/power/cpupower/utils/helpers/helpers.h')
-rw-r--r--tools/power/cpupower/utils/helpers/helpers.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/power/cpupower/utils/helpers/helpers.h b/tools/power/cpupower/utils/helpers/helpers.h
index 357b19bb136e..c258eeccd05f 100644
--- a/tools/power/cpupower/utils/helpers/helpers.h
+++ b/tools/power/cpupower/utils/helpers/helpers.h
@@ -69,6 +69,7 @@ enum cpupower_cpu_vendor {X86_VENDOR_UNKNOWN = 0, X86_VENDOR_INTEL,
#define CPUPOWER_CAP_HAS_TURBO_RATIO 0x00000010
#define CPUPOWER_CAP_IS_SNB 0x00000020
#define CPUPOWER_CAP_INTEL_IDA 0x00000040
+#define CPUPOWER_CAP_AMD_RDPRU 0x00000080
#define CPUPOWER_AMD_CPBDIS 0x02000000