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:   Tue, 14 Jun 2022 07:14:14 +0530
From:   Anshuman Khandual <anshuman.khandual@....com>
To:     German Gomez <german.gomez@....com>, linux-kernel@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org, peterz@...radead.org,
        acme@...nel.org, mark.rutland@....com, will@...nel.org
Cc:     Catalin Marinas <catalin.marinas@....com>,
        James Clark <james.clark@....com>,
        Rob Herring <robh@...nel.org>, Marc Zyngier <maz@...nel.org>,
        Ingo Molnar <mingo@...hat.com>,
        linux-perf-users@...r.kernel.org
Subject: Re: [PATCH 7/8] arm64/perf: Add BRBE driver



On 6/13/22 17:46, German Gomez wrote:
> Hi Anshuman, thanks for the update,
> 
> As I mentioned offline, I have a perf test that I've been using for the
> branch records and filters. I'll let you know the result using this set.

Sure, thanks !

> 
> On 13/06/2022 11:01, Anshuman Khandual wrote:
>> [...]
>>
>> +
>> +static int brbe_fetch_perf_priv(u64 brbinf)
>> +{
>> +       int brbe_el = brbe_fetch_el(brbinf);
>> +
>> +       switch (brbe_el) {
>> +       case BRBINF_EL_EL0:
>> +               return PERF_BR_PRIV_USER;
>> +       case BRBINF_EL_EL1:
>> +               return PERF_BR_PRIV_KERNEL;
>> +       case BRBINF_EL_EL2:
>> +               if (is_kernel_in_hyp_mode())
>> +                       return PERF_BR_PRIV_KERNEL;
>> +               return PERF_BR_PRIV_HV;
>> +       default:
>> +               pr_warn("unknown branch privilege captured\n");
>> +               return -1;
> 
> This looks like it should return PERF_BR_PRIV_UNKNOWN.

Right, return from this function gets into perf branch record's priv
element and '-1' is not something that can be parsed correctly in the
user space tools as the corresponding enum itself starts with 0 i.e
PERF_BR_PRIV_UNKNOWN.

cpuc->brbe_entries[idx].priv = brbe_fetch_perf_priv(brbinf)

Will change the return as PERF_BR_PRIV_UNKNOWN instead.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ