Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] coresight: Prevent per-thread events from sharing a sink
@ 2026-07-09 10:57 James Clark
  2026-07-09 10:57 ` [PATCH 1/4] coresight: tmc-etr: " James Clark
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: James Clark @ 2026-07-09 10:57 UTC (permalink / raw)
  To: Suzuki K Poulose, Mike Leach, Leo Yan, Mathieu Poirier,
	Greg Kroah-Hartman, Qi Liu, Junhao He, Jonathan Cameron
  Cc: coresight, linux-arm-kernel, linux-kernel, James Clark

Concurrent per-thread events results in a WARN on N1SDP which leads to
the realization that per-thread events shouldn't have been sharing sinks
in the first place.

This slips through because different events will have the same PID if
owned by the same process, and we only check the PID and nothing else.
That results in unexpected WARNs because it looks like we assumed it
couldn't happen (although exclusive PMU rules allow it). But even if it
was supported it would result in trace from the wrong thread in another
event's per-thread buffer, so we should disallow it.

Fix it everywhere the same PID checking logic was copy pasted. Then the
PIDs can be dropped from a few structs as they are now unused.

Signed-off-by: James Clark <james.clark@linaro.org>
---
James Clark (4):
      coresight: tmc-etr: Prevent per-thread events from sharing a sink
      coresight: tmc-etf: Prevent per-thread events from sharing a sink
      coresight: etb10: Prevent per-thread events from sharing a sink
      coresight: ultrasoc-smb: Prevent per-thread events from sharing a sink

 drivers/hwtracing/coresight/coresight-core.c     | 24 +++++++++++++++++++
 drivers/hwtracing/coresight/coresight-etb10.c    | 30 +++++++-----------------
 drivers/hwtracing/coresight/coresight-priv.h     |  2 --
 drivers/hwtracing/coresight/coresight-tmc-core.c |  2 --
 drivers/hwtracing/coresight/coresight-tmc-etf.c  | 23 ++++++------------
 drivers/hwtracing/coresight/coresight-tmc-etr.c  | 20 +++++-----------
 drivers/hwtracing/coresight/coresight-tmc.h      |  2 +-
 drivers/hwtracing/coresight/ultrasoc-smb.c       | 22 +++++------------
 drivers/hwtracing/coresight/ultrasoc-smb.h       |  5 ++--
 include/linux/coresight.h                        |  3 +++
 10 files changed, 57 insertions(+), 76 deletions(-)
---
base-commit: 98495b5a4d77dd22e106f462b76e1093a55b29a7
change-id: 20260708-james-cs-multiple-per-threads-ed1d25ed1734

Best regards,
-- 
James Clark <james.clark@linaro.org>



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-07-09 10:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-09 10:57 [PATCH 0/4] coresight: Prevent per-thread events from sharing a sink James Clark
2026-07-09 10:57 ` [PATCH 1/4] coresight: tmc-etr: " James Clark
2026-07-09 10:57 ` [PATCH 2/4] coresight: tmc-etf: " James Clark
2026-07-09 10:57 ` [PATCH 3/4] coresight: etb10: " James Clark
2026-07-09 10:57 ` [PATCH 4/4] coresight: ultrasoc-smb: " James Clark

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox