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]
Date:   Wed, 20 Oct 2021 21:25:20 +0800
From:   Leo Yan <leo.yan@...aro.org>
To:     German Gomez <german.gomez@....com>
Cc:     linux-kernel@...r.kernel.org, linux-perf-users@...r.kernel.org,
        John Garry <john.garry@...wei.com>,
        Will Deacon <will@...nel.org>,
        Mathieu Poirier <mathieu.poirier@...aro.org>,
        Mark Rutland <mark.rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Jiri Olsa <jolsa@...hat.com>,
        Namhyung Kim <namhyung@...nel.org>,
        Mike Leach <mike.leach@...aro.org>,
        linux-arm-kernel@...ts.infradead.org, coresight@...ts.linaro.org,
        James Clark <james.clark@....com>
Subject: Re: [PATCH 4/5] perf arm-spe: Implement find_snapshot callback

On Tue, Oct 19, 2021 at 06:34:24PM +0100, German Gomez wrote:
> Hi Leo,
> 
> On 17/10/2021 13:05, Leo Yan wrote:
> > On Thu, Sep 16, 2021 at 04:46:34PM +0100, German Gomez wrote:
> >
> > [...]
> >
> > If run a test case (the test is pasted at the end of the reply), I
> > can get quite different AUX trace data with passing different wait
> > period before sending the first USR2 signal.
> >
> >   # sh test_arm_spe_snapshot.sh 2
> >   Couldn't synthesize bpf events.
> >   stress: info: [5768] dispatching hogs: 1 cpu, 0 io, 0 vm, 0 hdd
> >   [ perf record: Woken up 3 times to write data ]
> >   [ perf record: Captured and wrote 2.833 MB perf.data ]
> >
> >   # sh test_arm_spe_snapshot.sh 10
> >   Couldn't synthesize bpf events.
> >   stress: info: [5776] dispatching hogs: 1 cpu, 0 io, 0 vm, 0 hdd
> >   [ perf record: Woken up 3 times to write data ]
> >   [ perf record: Captured and wrote 24.356 MB perf.data ]
> >
> > The first command passes argument '2' so the test will wait for 2
> > seconds before send USR2 signal for snapshot, and the perf data file is
> > 2.833 MB (so this means the Arm SPE trace data is about 2MB) for three
> > snapshots.  In the second command, the argument '10' means it will wait
> > for 10 seconds before sending the USR2 signals, and every time it records
> > the trace data from the full AUX buffer (8MB), at the end it gets 24MB
> > AUX trace data.
> >
> > The issue happens in the second command, waiting for 10 seconds leads
> > to the *full* AUX ring buffer is filled by Arm SPE, so the function
> > arm_spe_buffer_has_wrapped() always return back true for this case.
> > Afterwards, arm_spe_find_snapshot() doesn't respect the passed old
> > header (from '*old') and assumes the trace data size is 'mm->len'.
> 
> Returning the entire contents of the buffer once the first wrap-around
> was detected was the intention of the patch, so I don't currently see it
> as wrong. What were the values you were expecting to see in the test?

I expect the second command takes three snapshots: the first time it
should record AUX trace data with full buffer size (8MB) after waiting
for 10 seconds, and later two times will take small AUX trace data since
the interval (0.03s) is short and Arm SPE has not filled the full AUX
buffer.

> If the handling of snapshot mode by the perf tool can be improved after
> upstreaming the changes to the driver, we could submit a followup patch
> after that has been fixed.

Okay, I understand now the main concern is for kernel driver changes,
this patch for perf tool is fine for me:

Reviewed-by: Leo Yan <leo.yan@...aro.org>
Tested-by: Leo Yan <leo.yan@...aro.org>

[...]

> I will try these and the other driver changes and discuss them with the
> team internally, thanks!

Thanks a lot!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ