]> git.baikalelectronics.ru Git - kernel.git/commit
perf: Consider OS filter fail
authorPeter Zijlstra <peterz@infradead.org>
Sat, 19 Nov 2022 02:45:54 +0000 (10:45 +0800)
committerPeter Zijlstra <peterz@infradead.org>
Thu, 24 Nov 2022 09:12:23 +0000 (10:12 +0100)
commite632f0580c1792ef148a2eb34196c5df8f3996d4
treef3277a7dcea86cbb7257a441ea2d578f3a737fc1
parent895feb44aaacf4af41cbf02e575597dd41402574
perf: Consider OS filter fail

Some PMUs (notably the traditional hardware kind) have boundary issues
with the OS filter. Specifically, it is possible for
perf_event_attr::exclude_kernel=1 events to trigger in-kernel due to
SKID or errata.

This can upset the sigtrap logic some and trigger the WARN.

However, if this invalid sample is the first we must not loose the
SIGTRAP, OTOH if it is the second, it must not override the
pending_addr with a (possibly) invalid one.

Fixes: 13c3cfc748ac ("perf: Fix missing SIGTRAPs")
Reported-by: Pengfei Xu <pengfei.xu@intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Marco Elver <elver@google.com>
Tested-by: Pengfei Xu <pengfei.xu@intel.com>
Link: https://lkml.kernel.org/r/Y3hDYiXwRnJr8RYG@xpf.sh.intel.com
kernel/events/core.c