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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Thu, 13 Apr 2023 10:36:00 -0400
From:   "Liang, Kan" <kan.liang@...ux.intel.com>
To:     Ian Rogers <irogers@...gle.com>
Cc:     Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Jiri Olsa <jolsa@...nel.org>,
        Namhyung Kim <namhyung@...nel.org>,
        Adrian Hunter <adrian.hunter@...el.com>,
        Florian Fischer <florian.fischer@...q.space>,
        linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1] perf stat: Introduce skippable evsels



On 2023-04-13 9:52 a.m., Ian Rogers wrote:
> On Thu, Apr 13, 2023 at 6:36 AM Liang, Kan <kan.liang@...ux.intel.com> wrote:
>>
>>
>>
>> On 2023-04-12 2:01 p.m., Ian Rogers wrote:
>>>> - We shouldn't only rely on the event list file. We need to do runtime
>>>> check on the availability of events. Either perf_event_open() or
>>>> /sys/devices/cpu/events/ is fine (althourh personally I prefer sys way,
>>>> since I think it's easier).
>>> Using perf_event_open is the status quo and the sysfs approach is
>>> impractical imo. I think the only thing that is needed in v2 is for
>>> <not counted> to be displayed for skippable evsels.
>>
>> Using perf_event_open is good to check features. If the feature is not
>> supported by the kernel, it will be explicitly rejected.
>> But I'm not sure about the availability of events. The kernel doesn't
>> check every events. For example, on ICL and later platform, we have
>> event=0x00,umask=0x8X for all the topdown metrics events. If we open
>> them on SKL, the perf_event_open will also success, but return 0 value.
> 
> Thanks Kan,
> 
> The behavior change in perf-tools-next is to use the TopdownL1 metric
> group rather than programming the events and then having hard coded
> metrics if we spot the events enabled. On SKL the TopdownL1 metric
> group will give SKL top down metrics which don't use topdown events
> because, as you point out, they don't exist. The only way to program
> event=0x00,umask=0x8X on SKL would be through a raw event, so I don't
> think there is any issue here.

On ICL/SPR, even if the perf metrics feature isn't available (e.g., in
VM), the current kernel doesn't reject the event=0x00,umask=0x8X, which
the TopdownL1 will eventually use.
But maybe the best way is to change the kernel to not only hide the
topdown metrics event but also explicitly reject them, if the feature is
not available.

Thanks,
Kan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ