[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230602194513.1589179-1-namhyung@kernel.org>
Date: Fri, 2 Jun 2023 12:45:13 -0700
From: Namhyung Kim <namhyung@...nel.org>
To: Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...nel.org>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>,
Jiri Olsa <jolsa@...nel.org>, Ian Rogers <irogers@...gle.com>,
Adrian Hunter <adrian.hunter@...el.com>,
LKML <linux-kernel@...r.kernel.org>,
Stephane Eranian <eranian@...gle.com>,
Ravi Bangoria <ravi.bangoria@....com>
Subject: [PATCH] perf/x86/amd: Reject branch stack for IBS events
The AMD IBS PMU doesn't handle branch stacks, so it should not accept
events with brstack.
Cc: Ravi Bangoria <ravi.bangoria@....com>
Signed-off-by: Namhyung Kim <namhyung@...nel.org>
---
arch/x86/events/amd/ibs.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/x86/events/amd/ibs.c b/arch/x86/events/amd/ibs.c
index 371014802191..607a692ba8ce 100644
--- a/arch/x86/events/amd/ibs.c
+++ b/arch/x86/events/amd/ibs.c
@@ -265,6 +265,9 @@ static int perf_ibs_init(struct perf_event *event)
if (config & ~perf_ibs->config_mask)
return -EINVAL;
+ if (has_branch_stack(event))
+ return -EOPNOTSUPP;
+
if (hwc->sample_period) {
if (config & perf_ibs->cnt_mask)
/* raw max_cnt may not be set */
--
2.41.0.rc2.161.g9c6817b8e7-goog
Powered by blists - more mailing lists