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: <ecc69e40-f975-69e8-a372-6aafde66e0af@amd.com>
Date:   Mon, 5 Jun 2023 15:04:45 +0530
From:   Ravi Bangoria <ravi.bangoria@....com>
To:     Mark Rutland <mark.rutland@....com>
Cc:     Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
        "Peter Zijlstra (Intel)" <peterz@...radead.org>, jolsa@...nel.org,
        irogers@...gle.com, bp@...en8.de, adrian.hunter@...el.com,
        linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org,
        "linux-samsung-soc@...r.kernel.org" 
        <linux-samsung-soc@...r.kernel.org>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        "regressions@...ts.linux.dev" <regressions@...ts.linux.dev>,
        Ravi Bangoria <ravi.bangoria@....com>
Subject: Re: [REGRESSION][BISECT] perf/core: Remove pmu linear searching code

On 05-Jun-23 12:40 PM, Mark Rutland wrote:
> On Sun, Jun 04, 2023 at 01:38:10PM +0200, Krzysztof Kozlowski wrote:
>> Hi,
>>
>> #regzbot introduced: 9551fbb64d09
>>
>> Bisect pointed to commit 9551fbb64d09 ("perf/core: Remove pmu linear
>> searching code") as first one where all hardware events are gone from
>> perf for ARMv7 Exynos5422 board.
> 
> I think that commit 9551fbb64d09 is just wrong.
> 
> The commit message asserts:
> 
>   Searching for the right pmu by iterating over all pmus is no longer
>   required since all pmus now *must* be present in the 'pmu_idr' list.
>   So, remove linear searching code.
> 
> ... and while each PMU has *some* entry in the pmu_idr list, for its dynamic
> type, that means that events with other types (e.g. PERF_TYPE_HARDWARE or
> PERF_TYPE_RAW) will fail to find a PMU in the IDR whereas they'd previously
> have been accepted by a PMU during the subsequent iteration over all PMUs.

Not sure I follow.

PERF_TYPE_HARDWARE and PERF_TYPE_HW_CACHE are aliased to PERF_TYPE_RAW in
perf_init_event(). And PERF_TYPE_RAW should be present in pmu_idr if it
was registered using:

  perf_pmu_register(pmu, "name", PERF_TYPE_RAW);

In fact, all static pmu types (enum perf_type_id) are also added to pmu_idr.
See (type >= 0) checks in perf_pmu_register() code:

        if (type >= 0)
                max = type;

        ret = idr_alloc(&pmu_idr, pmu, max, 0, GFP_KERNEL);
        if (ret < 0)
                goto free_pdc;

        WARN_ON(type >= 0 && ret != type);

Thanks,
Ravi

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ