From: Greg Kroah-Hartman Date: Tue, 29 Sep 2020 14:27:25 +0000 (+0200) Subject: drop queue-4.19/perf-stat-force-error-in-fallback-on-k-events.patch X-Git-Tag: v4.4.238~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=969e5ada0b572e14ecfb445e12ba1cc17fed8604;p=thirdparty%2Fkernel%2Fstable-queue.git drop queue-4.19/perf-stat-force-error-in-fallback-on-k-events.patch --- diff --git a/queue-4.19/perf-stat-force-error-in-fallback-on-k-events.patch b/queue-4.19/perf-stat-force-error-in-fallback-on-k-events.patch deleted file mode 100644 index ae3490a4df6..00000000000 --- a/queue-4.19/perf-stat-force-error-in-fallback-on-k-events.patch +++ /dev/null @@ -1,119 +0,0 @@ -From 95e34517788e76dc1811a2853d2b86f7dd0f6135 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Tue, 14 Apr 2020 09:15:50 -0700 -Subject: perf stat: Force error in fallback on :k events - -From: Stephane Eranian - -[ Upstream commit bec49a9e05db3dbdca696fa07c62c52638fb6371 ] - -When it is not possible for a non-privilege perf command to monitor at -the kernel level (:k), the fallback code forces a :u. That works if the -event was previously monitoring both levels. But if the event was -already constrained to kernel only, then it does not make sense to -restrict it to user only. - -Given the code works by exclusion, a kernel only event would have: - - attr->exclude_user = 1 - -The fallback code would add: - - attr->exclude_kernel = 1 - -In the end the end would not monitor in either the user level or kernel -level. In other words, it would count nothing. - -An event programmed to monitor kernel only cannot be switched to user -only without seriously warning the user. - -This patch forces an error in this case to make it clear the request -cannot really be satisfied. - -Behavior with paranoid 1: - - $ sudo bash -c "echo 1 > /proc/sys/kernel/perf_event_paranoid" - $ perf stat -e cycles:k sleep 1 - - Performance counter stats for 'sleep 1': - - 1,520,413 cycles:k - - 1.002361664 seconds time elapsed - - 0.002480000 seconds user - 0.000000000 seconds sys - -Old behavior with paranoid 2: - - $ sudo bash -c "echo 2 > /proc/sys/kernel/perf_event_paranoid" - $ perf stat -e cycles:k sleep 1 - Performance counter stats for 'sleep 1': - - 0 cycles:ku - - 1.002358127 seconds time elapsed - - 0.002384000 seconds user - 0.000000000 seconds sys - -New behavior with paranoid 2: - - $ sudo bash -c "echo 2 > /proc/sys/kernel/perf_event_paranoid" - $ perf stat -e cycles:k sleep 1 - Error: - You may not have permission to collect stats. - - Consider tweaking /proc/sys/kernel/perf_event_paranoid, - which controls use of the performance events system by - unprivileged users (without CAP_PERFMON or CAP_SYS_ADMIN). - - The current value is 2: - - -1: Allow use of (almost) all events by all users - Ignore mlock limit after perf_event_mlock_kb without CAP_IPC_LOCK - >= 0: Disallow ftrace function tracepoint by users without CAP_PERFMON or CAP_SYS_ADMIN - Disallow raw tracepoint access by users without CAP_SYS_PERFMON or CAP_SYS_ADMIN - >= 1: Disallow CPU event access by users without CAP_PERFMON or CAP_SYS_ADMIN - >= 2: Disallow kernel profiling by users without CAP_PERFMON or CAP_SYS_ADMIN - - To make this setting permanent, edit /etc/sysctl.conf too, e.g.: - - kernel.perf_event_paranoid = -1 - -v2 of this patch addresses the review feedback from jolsa@redhat.com. - -Signed-off-by: Stephane Eranian -Reviewed-by: Ian Rogers -Acked-by: Jiri Olsa -Tested-by: Arnaldo Carvalho de Melo -Cc: Alexander Shishkin -Cc: Jiri Olsa -Cc: Mark Rutland -Cc: Namhyung Kim -Cc: Peter Zijlstra -Link: http://lore.kernel.org/lkml/20200414161550.225588-1-irogers@google.com -Signed-off-by: Arnaldo Carvalho de Melo -Signed-off-by: Sasha Levin ---- - tools/perf/util/evsel.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c -index 68c5ab0e1800b..e8586957562b3 100644 ---- a/tools/perf/util/evsel.c -+++ b/tools/perf/util/evsel.c -@@ -2796,6 +2796,10 @@ bool perf_evsel__fallback(struct perf_evsel *evsel, int err, - char *new_name; - const char *sep = ":"; - -+ /* If event has exclude user then don't exclude kernel. */ -+ if (evsel->core.attr.exclude_user) -+ return false; -+ - /* Is there already the separator in the name. */ - if (strchr(name, '/') || - strchr(name, ':')) --- -2.25.1 - diff --git a/queue-4.19/series b/queue-4.19/series index 4d0798ad909..a7ec9723273 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -143,7 +143,6 @@ mm-mmap.c-initialize-align_offset-explicitly-for-vm_.patch scsi-qedi-fix-termination-timeouts-in-session-logout.patch serial-uartps-wait-for-tx_empty-in-console-setup.patch kvm-remove-create_irqchip-set_pit2-race.patch -perf-stat-force-error-in-fallback-on-k-events.patch bdev-reduce-time-holding-bd_mutex-in-sync-in-blkdev_.patch drivers-char-tlclk.c-avoid-data-race-between-init-an.patch kvm-arm64-vgic-its-fix-memory-leak-on-the-error-path.patch