lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210702011018.GA251512@leoy-ThinkPad-X240s>
Date:   Fri, 2 Jul 2021 09:10:18 +0800
From:   Leo Yan <leo.yan@...aro.org>
To:     Arnaldo Carvalho de Melo <acme@...nel.org>
Cc:     Mathieu Poirier <mathieu.poirier@...aro.org>,
        Suzuki K Poulose <suzuki.poulose@....com>,
        Mike Leach <mike.leach@...aro.org>,
        James Clark <James.Clark@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        John Garry <john.garry@...wei.com>,
        Will Deacon <will@...nel.org>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Mark Rutland <mark.rutland@....com>,
        Jiri Olsa <jolsa@...hat.com>,
        Namhyung Kim <namhyung@...nel.org>, coresight@...ts.linaro.org,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        linux-perf-users@...r.kernel.org,
        Daniel Kiss <daniel.kiss@....com>,
        Denis Nikitin <denik@...gle.com>
Subject: Re: [PATCH v2 2/3] perf cs-etm: Remove callback
 cs_etm_find_snapshot()

On Thu, Jul 01, 2021 at 01:25:14PM -0300, Arnaldo Carvalho de Melo wrote:
> Em Thu, Jul 01, 2021 at 05:35:36PM +0800, Leo Yan escreveu:
> > The callback cs_etm_find_snapshot() is invoked for snapshot mode, its
> > main purpose is to find the correct AUX trace data and returns "head"
> > and "old" (we can call "old" as "old head") to the caller, the caller
> > __auxtrace_mmap__read() uses these two pointers to decide the AUX trace
> > data size.
> > 
> > This patch removes cs_etm_find_snapshot() with below reasons:
> > 
> > - The first thing in cs_etm_find_snapshot() is to check if the head has
> >   wrapped around, if it is not, directly bails out.  The checking is
> >   pointless, this is because the "head" and "old" pointers both are
> >   monotonical increasing so they never wrap around.
> > 
> > - cs_etm_find_snapshot() adjusts the "head" and "old" pointers and
> >   assumes the AUX ring buffer is fully filled with the hardware trace
> >   data, so it always subtracts the difference "mm->len" from "head" to
> >   get "old".  Let's imagine the snapshot is taken in very short
> >   interval, the tracers only fill a small chunk of the trace data into
> >   the AUX ring buffer, in this case, it's wrongly to copy the whole the
> >   AUX ring buffer to perf file.
> > 
> > - As the "head" and "old" pointers are monotonically increased, the
> >   function __auxtrace_mmap__read() handles these two pointers properly.
> >   It calculates the reminders for these two pointers, and the size is
> >   clamped to be never more than "snapshot_size".  We can simply reply on
> >   the function __auxtrace_mmap__read() to calculate the correct result
> >   for data copying, it's not necessary to add Arm CoreSight specific
> >   callback.
> 
> Thanks, applied.

Thanks a lot for picking up the patch, Arnaldo!

Hi Mathieu, I supposed to get your review before merging; since
Arnaldo moves quickly, if you want me to follow up anything relevant
to this change, please let me know.  Thanks!

Leo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ