[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <33988463-9168-4ac5-9061-8bba6e2eda37@nokia.com>
Date: Fri, 25 Oct 2024 19:56:02 +0200
From: Julien Meunier <julien.meunier@...ia.com>
To: Suzuki K Poulose <suzuki.poulose@....com>,
Mike Leach <mike.leach@...aro.org>, James Clark <james.clark@...aro.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Leo Yan <leo.yan@...ux.dev>
Cc: stable@...r.kernel.org, coresight@...ts.linaro.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] coresight: etm4x: Fix PID tracing when perf is run in
an init PID namespace
Hi Suzuki
On 21/10/2024 14:31, Suzuki K Poulose wrote:
> Hi Julien
>
>
[...]
>
> Unfortunately this is not safe. i.e., event->owner is not guaranteed to
> be stable (even NULL or an invalid pointer) (e.g. kernel created events
> or task exit raced event_start on another CPU).
I expected that event->owner was safe, but you are right. During my
tests, I essentially attached an existing PID executed in an container
(lxc), so I was not able to detect that race condition. I miss to
re-validate all the other usage of CoreSight.
> That said, one thing to note is that the ETM4x driver parses the event
> config in each "event_start" call back, instead of doing once during the
> event_init. If we move this to a onetime parsing at the event_init, with
> additional checks in place (e.g, !is_kernel_event()), we may be able to
> solve it.
Thanks for this suggestion, I will try this approach and provide a v3.
Regards,
Julien
Powered by blists - more mailing lists