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: <1c6a3a73-27dc-6673-7fe7-34bc7fcb0a68@arm.com>
Date:   Thu, 30 Sep 2021 13:26:15 +0100
From:   German Gomez <german.gomez@....com>
To:     Leo Yan <leo.yan@...aro.org>
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
Subject: Re: [PATCH 4/5] perf arm-spe: Implement find_snapshot callback

Hi Leo,

On 23/09/2021 15:40, Leo Yan wrote:
> On Thu, Sep 23, 2021 at 09:50:16PM +0800, Leo Yan wrote:
>
> [...]
>
>>> @@ -336,6 +480,7 @@ struct auxtrace_record *arm_spe_recording_init(int *err,
>>>   	sper->itr.pmu = arm_spe_pmu;
>>>   	sper->itr.snapshot_start = arm_spe_snapshot_start;
>>>   	sper->itr.snapshot_finish = arm_spe_snapshot_finish;
>>> +	sper->itr.find_snapshot = arm_spe_find_snapshot;
>> If I understand correctly, this patch copies the code from cs-etm for
>> snapshot handling.  About 2 months ago, we removed the Arm cs-etm's
>> specific snapshot callback function and directly use perf's function
>> __auxtrace_mmap__read() to handle 'head' and 'tail' pointers.  Please
>> see the commit for details:
>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2f01c200d4405c4562e45e8bb4de44a5ce37b217
>>
>> Before I review more details for snapshot enabling in patches 03 and
>> 04, could you confirm if Arm SPE can use the same way with cs-etm for
>> snapshot handling?  From my understanding, this is a better way to
>> handle AUX buffer's 'head' and 'tail'.
> In other words, if we can only apply patch 03 and can pass the testing
> in patch 05, then it would be a very neat implementation.
>
> I will try to verify these patches and will get back result.
>
> Thanks,
> Leo
The patch is indeed based on that commit. The reason behind it is that the
values for *head are being wrapped in the driver side (see the macro
PERF_IDX2OFF which is used at various points in 
/drivers/perf/arm_spe_pmu.c).

If this callback is not to be added, I believe the driver needs to be 
updated
first so that the head pointer monotonically increases like in cs-etm. 
Do you
think this makes sense for SPE?

(note that the patch will skip the wrap-around detection if this is the 
case,
in order to handle both cases in the userspace perf tool).

Thanks,
German

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ