kernel_optimize_test/arch/x86/events/intel
Alexander Shishkin ff61541cc6 perf/x86/intel/bts: Fix the use of page_private()
Commit

  8062382c8d ("perf/x86/intel/bts: Add BTS PMU driver")

brought in a warning with the BTS buffer initialization
that is easily tripped with (assuming KPTI is disabled):

instantly throwing:

> ------------[ cut here ]------------
> WARNING: CPU: 2 PID: 326 at arch/x86/events/intel/bts.c:86 bts_buffer_setup_aux+0x117/0x3d0
> Modules linked in:
> CPU: 2 PID: 326 Comm: perf Not tainted 5.4.0-rc8-00291-gceb9e77324fa #904
> RIP: 0010:bts_buffer_setup_aux+0x117/0x3d0
> Call Trace:
>  rb_alloc_aux+0x339/0x550
>  perf_mmap+0x607/0xc70
>  mmap_region+0x76b/0xbd0
...

It appears to assume (for lost raisins) that PagePrivate() is set,
while later it actually tests for PagePrivate() before using
page_private().

Make it consistent and always check PagePrivate() before using
page_private().

Fixes: 8062382c8d ("perf/x86/intel/bts: Add BTS PMU driver")
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Link: https://lkml.kernel.org/r/20191205142853.28894-2-alexander.shishkin@linux.intel.com
2019-12-17 13:32:46 +01:00
..
bts.c perf/x86/intel/bts: Fix the use of page_private() 2019-12-17 13:32:46 +01:00
core.c Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2019-11-26 15:04:47 -08:00
cstate.c perf/x86/cstate: Add Tiger Lake CPU support 2019-10-12 15:13:09 +02:00
ds.c perf/x86/intel: Support PEBS output to PT 2019-08-28 11:29:39 +02:00
knc.c
lbr.c perf/x86/intel: Implement LBR callstack context synchronization 2019-10-28 12:51:01 +01:00
Makefile
p4.c perf_event: Add support for LSM and SELinux checks 2019-10-17 21:31:55 +02:00
p6.c
pt.c perf/x86/intel/pt: Prevent redundant WRMSRs 2019-11-13 11:06:18 +01:00
pt.h perf/x86/intel/pt: Prevent redundant WRMSRs 2019-11-13 11:06:18 +01:00
rapl.c Merge branch 'x86-cpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2019-09-16 18:47:53 -07:00
uncore_nhmex.c
uncore_snb.c perf/x86/intel/uncore: Clean up client IMC 2019-06-17 12:36:21 +02:00
uncore_snbep.c perf/x86/intel/uncore: Add IMC uncore support for Snow Ridge 2019-06-17 12:36:22 +02:00
uncore.c perf/x86/uncore: Fix event group support 2019-10-28 11:02:01 +01:00
uncore.h perf/x86/uncore: Fix event group support 2019-10-28 11:02:01 +01:00