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: <ea242aea-0470-4eb8-fe44-03551dbbaaba@arm.com>
Date:   Tue, 13 Sep 2022 17:08:30 +0530
From:   Anshuman Khandual <anshuman.khandual@....com>
To:     James Clark <james.clark@....com>
Cc:     Rob Herring <robh@...nel.org>, Marc Zyngier <maz@...nel.org>,
        Ingo Molnar <mingo@...hat.com>, linux-kernel@...r.kernel.org,
        linux-perf-users@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org, peterz@...radead.org,
        acme@...nel.org, mark.rutland@....com, will@...nel.org,
        catalin.marinas@....com, German Gomez <german.gomez@....com>
Subject: Re: [PATCH V2 6/7] arm64/perf: Add BRBE driver



On 9/13/22 16:09, James Clark wrote:
> 
> 
> On 08/09/2022 06:10, Anshuman Khandual wrote:
>> This adds a BRBE driver which implements all the required helper functions
>> for struct arm_pmu. Following functions are defined by this driver which
>> will configure, enable, capture, reset and disable BRBE buffer HW as and
>> when requested via perf branch stack sampling framework.
>>
>> - arm64_pmu_brbe_filter()
>> - arm64_pmu_brbe_enable()
>> - arm64_pmu_brbe_disable()
>> - arm64_pmu_brbe_read()
>> - arm64_pmu_brbe_probe()
>> - arm64_pmu_brbe_reset()
>> - arm64_pmu_brbe_supported()
>>
>> Cc: Peter Zijlstra <peterz@...radead.org>
>> Cc: Ingo Molnar <mingo@...hat.com>
>> Cc: Arnaldo Carvalho de Melo <acme@...nel.org>
>> Cc: Mark Rutland <mark.rutland@....com>
>> Cc: Will Deacon <will@...nel.org>
>> Cc: Catalin Marinas <catalin.marinas@....com>
>> Cc: linux-arm-kernel@...ts.infradead.org
>> Cc: linux-perf-users@...r.kernel.org
>> Cc: linux-kernel@...r.kernel.org
>> Signed-off-by: Anshuman Khandual <anshuman.khandual@....com>
>> ---
>>  arch/arm64/kernel/perf_event.c |   8 +-
>>  drivers/perf/Kconfig           |  11 +
>>  drivers/perf/Makefile          |   1 +
>>  drivers/perf/arm_pmu_brbe.c    | 448 +++++++++++++++++++++++++++++++++
>>  drivers/perf/arm_pmu_brbe.h    | 259 +++++++++++++++++++
>>  include/linux/perf/arm_pmu.h   |  20 ++
>>  6 files changed, 746 insertions(+), 1 deletion(-)
>>  create mode 100644 drivers/perf/arm_pmu_brbe.c
>>  create mode 100644 drivers/perf/arm_pmu_brbe.h
>>
> [...]
>> +
>> +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;
> 
> On V1 you said that you would change this to PERF_BR_PRIV_UNKNOWN, looks
> like that was dropped. Unless it didn't work out?

Seems like it just got dropped unintentionally. Yes, PERF_BR_PRIV_UNKNOWN
can be returned here instead of "-1", similar to brbe_fetch_perf_type()
which returns PERF_BR_UNKNOWN.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ