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: <CANLsYkwUa+B6nrP+6gJ=U5a9NnxyohS2wCVstHR2O7gLryWbDw@mail.gmail.com>
Date:   Fri, 27 Jan 2017 10:17:53 -0700
From:   Mathieu Poirier <mathieu.poirier@...aro.org>
To:     Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Cc:     Peter Zijlstra <a.p.zijlstra@...llo.nl>,
        Ingo Molnar <mingo@...hat.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Vince Weaver <vince@...ter.net>,
        Stephane Eranian <eranian@...gle.com>,
        Arnaldo Carvalho de Melo <acme@...radead.org>,
        Will Deacon <will.deacon@....com>,
        Mark Rutland <mark.rutland@....com>
Subject: Re: [PATCH 1/3] perf, pt, coresight: Clean up address filter structure

On 27 January 2017 at 05:12, Alexander Shishkin
<alexander.shishkin@...ux.intel.com> wrote:
> Mathieu Poirier <mathieu.poirier@...aro.org> writes:
>
>> Hi Alex,
>
> Hi Mathieu,
>
>> This changes the behavior we used to have.  Now a range filter with a size of 0
>> will be treated as start filter rather than an error.  See below on a possible
>> way of fixing this.
>
> Not really. Currently we have 2 drivers using this and both reject the
> type=range&&size==0 filters with either -EOPNOTSUPP or -EINVAL. With
> this change, PT will still reject it as it doesn't support single
> address triggers, but Coresight will treat it as if it was a single
> address filter.

Hence my statement about a change in behaviour.

> Which makes sense, because that's what a range of size
> zero is. Note, that a range that covers one instruction has to be at
> least size==1 (and I'm guessing size==4 for Coresight, but I may be
> wrong).
>
> So yes, this does change the existing behavior, but in doing so it
> removes the ambiguity of zero sized ranges.

Specifying a size of zero with a range filter is wrong and as such
should be treated as an error, which is what the current code is
doing.  If people want a start filter they can use the syntax required
for that.  In my opinion treating a range filter with a size zero as a
start filter is adding intelligence to the machine, something that
should probably be avoided.

>
>>                         if (filter->action == PERF_ADDR_FILTER_ACTION_RANGE)
>
> But "range" is not an action, it's a type of a filter. It determines the
> condition that triggers an action. An action, however, is what we do
> when the condition comes true.

Then filter->action could be renamed 'type'.  In the end filters on PT
are range filters, the same way they are on CS.  But changing the
naming convention is a matter of personal opinion - I am fine with
what we currently have.

On the flip side reordering the fields in the 'if_tokens' match table
would allow to set the filters properly in
perf_event_parse_addr_filter(), keep the current behaviour intact and
get rid of filter->range.

Thanks,
Mathieu

>
> Regards,
> --
> Alex

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ