kaiser: fix perf crashes
authorHugh Dickins <hughd@google.com>
Wed, 23 Aug 2017 21:21:14 +0000 (14:21 -0700)
committerYves-Alexis Perez <corsac@debian.org>
Thu, 4 Jan 2018 11:12:40 +0000 (11:12 +0000)
commit029dd1f95f7d001275fdaa7583dbbd81687c6075
treed312a3598f33f97b15718cd7968c9adc5e728173
parent0fcf765837fb4c4ab508a3487249584a701a5e74
kaiser: fix perf crashes

Avoid perf crashes: place debug_store in the user-mapped per-cpu area
instead of allocating, and use page allocator plus kaiser_add_mapping()
to keep the BTS and PEBS buffers user-mapped (that is, present in the
user mapping, though visible only to kernel and hardware).  The PEBS
fixup buffer does not need this treatment.

The need for a user-mapped struct debug_store showed up before doing
any conscious perf testing: in a couple of kernel paging oopses on
Westmere, implicating the debug_store offset of the per-cpu area.

Signed-off-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Gbp-Pq: Topic features/all/kpti
Gbp-Pq: Name kaiser-fix-perf-crashes.patch
arch/x86/events/intel/ds.c