kaiser: fix perf crashes
authorHugh Dickins <hughd@google.com>
Wed, 23 Aug 2017 21:21:14 +0000 (14:21 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 5 Jan 2018 14:46:33 +0000 (15:46 +0100)
commitf881e626849c62641a91a13cb5344908c6613d11
tree166b5f5ec4071c2cd0a8c740b238b507a1fcb192
parent19377944317f7d1f706d7da2c7cea5c4bcb7440b
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>
arch/x86/events/intel/ds.c