Skip to contentSkip to conversation

perf/x86/amd: Reject branch stack for IBS events

PATCH In review Namhyung Kim 3 participants 10 messages Jun 2, 2023 – Dec 4, 2023

Subsystems (2)
lore
Share & tools
lore

Namhyung Kim

author maintainer
#0 lore raw

PATCH 1/1 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.

---
 arch/x86/events/amd/ibs.c | 3 +++
 1 file changed, 3 insertions(+)
arch/x86/events/amd/ibs.c +3 -0
index 371014802191..607a692ba8ce 100644
@@ -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 */
Signature · 1 line
2.41.0.rc2.161.g9c6817b8e7-goog
#3 lore raw
Quoted 11 lines · Arnaldo Carvalho de Melo

Em Tue, Jun 06, 2023 at 10:08:43AM +0530, Ravi Bangoria escreveu:

Quoted 8 lines · Namhyung Kim
Quoted 5 lines

The AMD IBS PMU doesn't handle branch stacks, so it should not accept events with brstack.

It seems this patch was not merged, can you please check?

Right. And it does not apply cleanly on peterz/queue.git/perf/core, since surrounding code has changed.

Thanks,
Ravi

#4 lore raw

Em Fri, Nov 24, 2023 at 09:30:37AM +0530, Ravi Bangoria escreveu:

Quoted 9 lines · Arnaldo Carvalho de Melo
Quoted 8 lines

Em Tue, Jun 06, 2023 at 10:08:43AM +0530, Ravi Bangoria escreveu:

Quoted 7 lines · Namhyung Kim
Quoted 5 lines

The AMD IBS PMU doesn't handle branch stacks, so it should not accept events with brstack.

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

It seems this patch was not merged, can you please check?

Right. And it does not apply cleanly on peterz/queue.git/perf/core, since surrounding code has changed.

Can you please refresh it if PeterZ has nothing against?

- Arnaldo

#5 lore raw
Quoted 10 lines · Arnaldo Carvalho de Melo

Em Fri, Nov 24, 2023 at 09:30:37AM +0530, Ravi Bangoria escreveu:

Quoted 9 lines · Arnaldo Carvalho de Melo
Quoted 8 lines

Em Tue, Jun 06, 2023 at 10:08:43AM +0530, Ravi Bangoria escreveu:

Quoted 7 lines · Namhyung Kim
Quoted 5 lines

The AMD IBS PMU doesn't handle branch stacks, so it should not accept events with brstack.

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line

It seems this patch was not merged, can you please check?

Right. And it does not apply cleanly on peterz/queue.git/perf/core, since surrounding code has changed.

Can you please refresh it if PeterZ has nothing against?

Posted v2: https://lore.kernel.org/r/[email protected]

Thanks.

#6 lore raw

Em Thu, Nov 30, 2023 at 11:58:15AM +0530, Ravi Bangoria escreveu:

Quoted 11 lines · Arnaldo Carvalho de Melo
Quoted 9 lines

Em Fri, Nov 24, 2023 at 09:30:37AM +0530, Ravi Bangoria escreveu:

Quoted 8 lines · Arnaldo Carvalho de Melo
Quoted 7 lines

Em Tue, Jun 06, 2023 at 10:08:43AM +0530, Ravi Bangoria escreveu:

Quoted 6 lines · Namhyung Kim
Quoted 4 lines

The AMD IBS PMU doesn't handle branch stacks, so it should not accept events with brstack.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 1 line

It seems this patch was not merged, can you please check?

Right. And it does not apply cleanly on peterz/queue.git/perf/core, since surrounding code has changed.

Can you please refresh it if PeterZ has nothing against?

Posted v2: https://lore.kernel.org/r/[email protected]

Peter, can you please consider this one?

Thanks a lot!

- Arnaldo

author maintainer
#7 lore raw
Quoted 15 lines · Arnaldo Carvalho de Melo

Em Thu, Nov 30, 2023 at 11:58:15AM +0530, Ravi Bangoria escreveu:

Quoted 12 lines · Arnaldo Carvalho de Melo
Quoted 11 lines

Em Fri, Nov 24, 2023 at 09:30:37AM +0530, Ravi Bangoria escreveu:

Quoted 10 lines · Arnaldo Carvalho de Melo
Quoted 9 lines

Em Tue, Jun 06, 2023 at 10:08:43AM +0530, Ravi Bangoria escreveu:

Quoted 6 lines · Namhyung Kim
Quoted 4 lines

The AMD IBS PMU doesn't handle branch stacks, so it should not accept events with brstack.

It seems this patch was not merged, can you please check?

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

Right. And it does not apply cleanly on peterz/queue.git/perf/core, since surrounding code has changed.

Can you please refresh it if PeterZ has nothing against?

Posted v2: https://lore.kernel.org/r/[email protected]

Peter, can you please consider this one?

The v2 is already in the tip tree. Thanks Ravi for doing this! Namhyung

#8 lore raw

Em Fri, Dec 01, 2023 at 12:23:16PM -0800, Namhyung Kim escreveu:

Quoted 20 lines
Quoted 18 lines · Arnaldo Carvalho de Melo

Em Thu, Nov 30, 2023 at 11:58:15AM +0530, Ravi Bangoria escreveu:

Quoted 15 lines · Arnaldo Carvalho de Melo
Quoted 14 lines

Em Fri, Nov 24, 2023 at 09:30:37AM +0530, Ravi Bangoria escreveu:

Quoted 13 lines · Arnaldo Carvalho de Melo
Quoted 9 lines

Em Tue, Jun 06, 2023 at 10:08:43AM +0530, Ravi Bangoria escreveu:

Quoted 6 lines · Namhyung Kim
Quoted 4 lines

The AMD IBS PMU doesn't handle branch stacks, so it should not accept events with brstack.

It seems this patch was not merged, can you please check?

Right. And it does not apply cleanly on peterz/queue.git/perf/core, since surrounding code has changed.

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line

Can you please refresh it if PeterZ has nothing against?

Posted v2: https://lore.kernel.org/r/[email protected]

Peter, can you please consider this one?

The v2 is already in the tip tree. Thanks Ravi for doing this! Namhyung

yay!

- Arnaldo

#9 lore raw
In reply to Namhyung Kim

Em Fri, Dec 01, 2023 at 12:23:16PM -0800, Namhyung Kim escreveu:

Quoted 18 lines · Arnaldo Carvalho de Melo
Quoted 16 lines

Em Thu, Nov 30, 2023 at 11:58:15AM +0530, Ravi Bangoria escreveu:

Quoted 15 lines · Arnaldo Carvalho de Melo
Quoted 14 lines

Em Fri, Nov 24, 2023 at 09:30:37AM +0530, Ravi Bangoria escreveu:

Quoted 13 lines · Arnaldo Carvalho de Melo
Quoted 9 lines

Em Tue, Jun 06, 2023 at 10:08:43AM +0530, Ravi Bangoria escreveu:

Quoted 6 lines · Namhyung Kim
Quoted 4 lines

The AMD IBS PMU doesn't handle branch stacks, so it should not accept events with brstack.

It seems this patch was not merged, can you please check?

Right. And it does not apply cleanly on peterz/queue.git/perf/core, since surrounding code has changed.

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line

Can you please refresh it if PeterZ has nothing against?

Posted v2: https://lore.kernel.org/r/[email protected]

Peter, can you please consider this one?

The v2 is already in the tip tree. Thanks Ravi for doing this!

Yeap, I just checked and Ingo merged it, thanks everybody!

- Arnaldo