projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d8a8cfc
)
x86/perf: Fix CR4.PCE propagation to use active_mm instead of mm
author
Andy Lutomirski
<
[email protected]
>
Thu, 16 Mar 2017 19:59:39 +0000
(12:59 -0700)
committer
Ingo Molnar
<
[email protected]
>
Fri, 17 Mar 2017 07:28:26 +0000
(08:28 +0100)
If one thread mmaps a perf event while another thread in the same mm
is in some context where active_mm != mm (which can happen in the
scheduler, for example), refresh_pce() would write the wrong value
to CR4.PCE. This broke some PAPI tests.
Reported-and-tested-by: Vince Weaver <
[email protected]
>
Signed-off-by: Andy Lutomirski <
[email protected]
>
Cc: Alexander Shishkin <
[email protected]
>
Cc: Arnaldo Carvalho de Melo <
[email protected]
>
Cc: Borislav Petkov <
[email protected]
>
Cc: H. Peter Anvin <
[email protected]
>
Cc: Jiri Olsa <
[email protected]
>
Cc: Linus Torvalds <
[email protected]
>
Cc: Peter Zijlstra <
[email protected]
>
Cc: Stephane Eranian <
[email protected]
>
Cc: Thomas Gleixner <
[email protected]
>
Cc:
[email protected]
Fixes: 7911d3f7af14 ("perf/x86: Only allow rdpmc if a perf_event is mapped")
Link:
http://lkml.kernel.org/r/0c5b38a76ea50e405f9abe07a13dfaef87c173a1.1489694270.git.luto@kernel.org
Signed-off-by: Ingo Molnar <
[email protected]
>
arch/x86/events/core.c
patch
|
blob
|
history
diff --git
a/arch/x86/events/core.c
b/arch/x86/events/core.c
index 1635c0c8df23a697a93a8a7bd0dbbfd534c3caef..e07b36c5588afa95c42a880ea56898b0fd27e83e 100644
(file)
--- a/
arch/x86/events/core.c
+++ b/
arch/x86/events/core.c
@@
-2100,8
+2100,8
@@
static int x86_pmu_event_init(struct perf_event *event)
static void refresh_pce(void *ignored)
{
- if (current->mm)
- load_mm_cr4(current->mm);
+ if (current->
active_
mm)
+ load_mm_cr4(current->
active_
mm);
}
static void x86_pmu_event_mapped(struct perf_event *event)