[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-6dd273f44669de98bfff16371c09065671cbbad6@git.kernel.org>
Date: Mon, 21 Jan 2019 03:17:57 -0800
From: tip-bot for Andrew Murray <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: linux@...linux.org.uk, shawnguo@...nel.org, paulus@...ba.org,
peterz@...radead.org, mark.rutland@....com, hpa@...or.com,
mpe@...erman.id.au, ink@...assic.park.msu.ru,
s.hauer@...gutronix.de, andrew.murray@....com, mattst88@...il.com,
benh@...nel.crashing.org, tglx@...utronix.de,
linux-kernel@...r.kernel.org, bp@...en8.de, acme@...nel.org,
will.deacon@....com, mingo@...nel.org, rth@...ddle.net,
torvalds@...ux-foundation.org
Subject: [tip:perf/core] perf/core, arch/alpha: Strengthen exclusion checks
with PERF_PMU_CAP_NO_EXCLUDE
Commit-ID: 6dd273f44669de98bfff16371c09065671cbbad6
Gitweb: https://git.kernel.org/tip/6dd273f44669de98bfff16371c09065671cbbad6
Author: Andrew Murray <andrew.murray@....com>
AuthorDate: Thu, 10 Jan 2019 13:53:26 +0000
Committer: Ingo Molnar <mingo@...nel.org>
CommitDate: Mon, 21 Jan 2019 11:01:21 +0100
perf/core, arch/alpha: Strengthen exclusion checks with PERF_PMU_CAP_NO_EXCLUDE
As the Alpha PMU doesn't support context exclusion let's advertise
the PERF_PMU_CAP_NO_EXCLUDE capability. This ensures that perf will
prevent us from handling events where any exclusion flags are set.
Let's also remove the now unnecessary check for exclusion flags.
This change means that __hw_perf_event_init will now also
indicate that it doesn't support exclude_host and exclude_guest and
will now implicitly return -EINVAL instead of -EPERM. This is likely
more desirable as -EPERM will result in a kernel.perf_event_paranoid
related warning from the perf userspace utility.
Signed-off-by: Andrew Murray <andrew.murray@....com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: Benjamin Herrenschmidt <benh@...nel.crashing.org>
Cc: Borislav Petkov <bp@...en8.de>
Cc: Ivan Kokshaysky <ink@...assic.park.msu.ru>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Mark Rutland <mark.rutland@....com>
Cc: Matt Turner <mattst88@...il.com>
Cc: Michael Ellerman <mpe@...erman.id.au>
Cc: Paul Mackerras <paulus@...ba.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Richard Henderson <rth@...ddle.net>
Cc: Russell King <linux@...linux.org.uk>
Cc: Sascha Hauer <s.hauer@...gutronix.de>
Cc: Shawn Guo <shawnguo@...nel.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Will Deacon <will.deacon@....com>
Cc: linux-arm-kernel@...ts.infradead.org
Cc: linuxppc-dev@...ts.ozlabs.org
Cc: robin.murphy@....com
Cc: suzuki.poulose@....com
Link: https://lkml.kernel.org/r/1547128414-50693-5-git-send-email-andrew.murray@arm.com
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
arch/alpha/kernel/perf_event.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/arch/alpha/kernel/perf_event.c b/arch/alpha/kernel/perf_event.c
index 5613aa378a83..4341ccf5c0c4 100644
--- a/arch/alpha/kernel/perf_event.c
+++ b/arch/alpha/kernel/perf_event.c
@@ -630,12 +630,6 @@ static int __hw_perf_event_init(struct perf_event *event)
return ev;
}
- /* The EV67 does not support mode exclusion */
- if (attr->exclude_kernel || attr->exclude_user
- || attr->exclude_hv || attr->exclude_idle) {
- return -EPERM;
- }
-
/*
* We place the event type in event_base here and leave calculation
* of the codes to programme the PMU for alpha_pmu_enable() because
@@ -771,6 +765,7 @@ static struct pmu pmu = {
.start = alpha_pmu_start,
.stop = alpha_pmu_stop,
.read = alpha_pmu_read,
+ .capabilities = PERF_PMU_CAP_NO_EXCLUDE,
};
Powered by blists - more mailing lists