linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/4] coresight: etm: Correct (virtual) contextID tracing for namespace
@ 2021-10-31 14:42 Leo Yan
  2021-10-31 14:42 ` [PATCH v1 1/4] coresight: etm4x: Add lock for reading virtual context ID comparator Leo Yan
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Leo Yan @ 2021-10-31 14:42 UTC (permalink / raw)
  To: Mathieu Poirier, Suzuki K Poulose, Mike Leach,
	Alexander Shishkin, James Clark, coresight, linux-arm-kernel,
	linux-kernel
  Cc: Leo Yan

If a profiling program runs in a non-root PID namespace, if CoreSight
driver enables contextID tracing, it can lead to mismatching issue
between the context ID in hardware trace data and the allocated PID in
the non-root namespace.

CoreSight driver has tried to address this issue for the contextID
related interfaces under sysfs, but it misses other parts: it doesn't
prevent user to set VMID (virtual contextID) for kernel runs in EL2 with
VHE, and furthermore, it misses to handle the perf mode when the
profiling tool (e.g. perf) doesn't run in root PID namespace.

For this reason, this patch series is to correct contextID tracing for
non-root namespace.

Patch 01 is to use spinlock to protect reading virtual context ID
comparator.

Patch 02 corrects the virtual contextID tracing for non-root PID
namespace.

Patch 03/04 are used to fix the contextID tracing for perf mode.

I only verified this patch series on Juno board in the root PID
namespace and confirmed the patches don't introduce any regression for
root PID namespace.


Leo Yan (4):
  coresight: etm4x: Add lock for reading virtual context ID comparator
  coresight: etm4x: Don't use virtual contextID for non-root PID
    namespace
  coresight: etm4x: Don't trace contextID for non-root namespace in perf
    mode
  coresight: etm3x: Don't trace contextID for non-root namespace in perf
    mode

 .../coresight/coresight-etm3x-core.c          |  4 +++
 .../coresight/coresight-etm4x-core.c          | 10 +++++--
 .../coresight/coresight-etm4x-sysfs.c         | 30 +++++++++++++++++++
 3 files changed, 42 insertions(+), 2 deletions(-)

-- 
2.25.1


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

end of thread, other threads:[~2021-11-17 13:53 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-31 14:42 [PATCH v1 0/4] coresight: etm: Correct (virtual) contextID tracing for namespace Leo Yan
2021-10-31 14:42 ` [PATCH v1 1/4] coresight: etm4x: Add lock for reading virtual context ID comparator Leo Yan
2021-11-01  9:49   ` Suzuki K Poulose
2021-11-01 10:59     ` Leo Yan
2021-10-31 14:42 ` [PATCH v1 2/4] coresight: etm4x: Don't use virtual contextID for non-root PID namespace Leo Yan
2021-11-04 15:07   ` Suzuki K Poulose
2021-11-04 15:24     ` Leo Yan
2021-10-31 14:42 ` [PATCH v1 3/4] coresight: etm4x: Don't trace contextID for non-root namespace in perf mode Leo Yan
2021-11-16  9:46   ` Suzuki K Poulose
2021-11-17 13:53     ` Leo Yan
2021-10-31 14:42 ` [PATCH v1 4/4] coresight: etm3x: " Leo Yan
2021-11-16 13:52 ` [PATCH v1 0/4] coresight: etm: Correct (virtual) contextID tracing for namespace Suzuki K Poulose

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).