diff options
author | Tudor Florea <tudor.florea@enea.com> | 2014-10-10 03:19:54 +0200 |
---|---|---|
committer | Tudor Florea <tudor.florea@enea.com> | 2014-10-10 03:19:54 +0200 |
commit | c158582c0fc7f4bd73980fe9adad446855f4d61b (patch) | |
tree | 31b701a2367cb983e76e76cd7c2ba176ad33e5ac /recipes-kernel/linux/files/perf-x86-fix-RAPL-rdmsrl_safe-usage.patch | |
download | meta-vt-c158582c0fc7f4bd73980fe9adad446855f4d61b.tar.gz |
initial commit for Enea Linux 4.0-140929daisy-140929
Migrated from the internal git server on the daisy-enea-point-release branch
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'recipes-kernel/linux/files/perf-x86-fix-RAPL-rdmsrl_safe-usage.patch')
-rw-r--r-- | recipes-kernel/linux/files/perf-x86-fix-RAPL-rdmsrl_safe-usage.patch | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/recipes-kernel/linux/files/perf-x86-fix-RAPL-rdmsrl_safe-usage.patch b/recipes-kernel/linux/files/perf-x86-fix-RAPL-rdmsrl_safe-usage.patch new file mode 100644 index 0000000..058e676 --- /dev/null +++ b/recipes-kernel/linux/files/perf-x86-fix-RAPL-rdmsrl_safe-usage.patch | |||
@@ -0,0 +1,29 @@ | |||
1 | From: Stephane Eranian | ||
2 | Date: Wed Apr 23 2014 - 13:04:31 EST | ||
3 | This patch fixes a bug introduced by commit 24223657. | ||
4 | |||
5 | perf/x86: fix RAPL rdmsrl_safe() usage | ||
6 | |||
7 | The rdmsrl_safe() function returns 0 on success. | ||
8 | The current code was failing to detect the RAPL PMU | ||
9 | on real hardware (missing /sys/devices/power) because | ||
10 | the return value of rdmsrl_safe() was misinterpreted. | ||
11 | |||
12 | Signed-off-by: Stephane Eranian <eranian@xxxxxxxxxx> | ||
13 | Upstream-Status: Backport [http://lkml.iu.edu/hypermail/linux/kernel/1404.2/05008.html] | ||
14 | |||
15 | diff --git a/arch/x86/kernel/cpu/perf_event_intel_rapl.c b/arch/x86/kernel/cpu/perf_event_intel_rapl.c | ||
16 | index 7c87424..619f769 100644 | ||
17 | --- a/arch/x86/kernel/cpu/perf_event_intel_rapl.c | ||
18 | +++ b/arch/x86/kernel/cpu/perf_event_intel_rapl.c | ||
19 | @@ -543,7 +543,8 @@ static int rapl_cpu_prepare(int cpu) | ||
20 | if (phys_id < 0) | ||
21 | return -1; | ||
22 | |||
23 | - if (!rdmsrl_safe(MSR_RAPL_POWER_UNIT, &msr_rapl_power_unit_bits)) | ||
24 | + /* protect rdmsrl() to handle virtualization */ | ||
25 | + if (rdmsrl_safe(MSR_RAPL_POWER_UNIT, &msr_rapl_power_unit_bits)) | ||
26 | return -1; | ||
27 | |||
28 | pmu = kzalloc_node(sizeof(*pmu), GFP_KERNEL, cpu_to_node(cpu)); | ||
29 | -- | ||