Thread (5 messages) 5 messages, 1 author, 12d ago
COOLING12d

[PATCH v2 0/4] coresight: Prevent per-thread events from sharing a sink

From: James Clark <james.clark@linaro.org>
Date: 2026-07-09 15:25:48
Also in: lkml

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>
---
Changes in v2:
- Fix inherited events by following event->parent
- Link to v1: https://lore.kernel.org/r/20260709-james-cs-multiple-per-threads-v1-0-d384e6d477ac@linaro.org (local)

---
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     | 31 ++++++++++++++++++++++++
 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, 64 insertions(+), 76 deletions(-)
---
base-commit: 98495b5a4d77dd22e106f462b76e1093a55b29a7
change-id: 20260708-james-cs-multiple-per-threads-ed1d25ed1734

Best regards,
-- 
James Clark [off-list ref]

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help