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] [day] [month] [year] [list]
Message-ID: <CAL_JsqJaavfSUGLs4Uoi7ibiYG6=ebzRsUnzdNMU9vo70FA-Xw@mail.gmail.com>
Date: Mon, 24 Jun 2024 14:14:08 -0600
From: Rob Herring <robh@...nel.org>
To: Will Deacon <will@...nel.org>
Cc: Mark Rutland <mark.rutland@....com>, James Clark <james.clark@....com>, 
	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] perf: arm_pmuv3: Avoid assigning fixed cycle counter with threshold

On Tue, Jun 18, 2024 at 9:41 AM Will Deacon <will@...nel.org> wrote:
>
> On Tue, Jun 11, 2024 at 09:50:12AM -0600, Rob Herring (Arm) wrote:
> > If the user has requested a counting threshold for the CPU cycles event,
> > then the fixed cycle counter can't be assigned as it lacks threshold
> > support. Currently, the thresholds will work or not randomly depending
> > on which counter the event is assigned.
> >
> > While using thresholds for CPU cycles doesn't make much sense, it can be
> > useful for testing purposes.
> >
> > Fixes: 816c26754447 ("arm64: perf: Add support for event counting threshold")
> > Signed-off-by: Rob Herring (Arm) <robh@...nel.org>
> > ---
> >  drivers/perf/arm_pmuv3.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/perf/arm_pmuv3.c b/drivers/perf/arm_pmuv3.c
> > index 23fa6c5da82c..2612be29ee23 100644
> > --- a/drivers/perf/arm_pmuv3.c
> > +++ b/drivers/perf/arm_pmuv3.c
> > @@ -939,9 +939,10 @@ static int armv8pmu_get_event_idx(struct pmu_hw_events *cpuc,
> >       struct arm_pmu *cpu_pmu = to_arm_pmu(event->pmu);
> >       struct hw_perf_event *hwc = &event->hw;
> >       unsigned long evtype = hwc->config_base & ARMV8_PMU_EVTYPE_EVENT;
> > +     bool has_threshold = !!(hwc->config_base & ARMV8_PMU_EVTYPE_TH);
>
> Just a nit, but I don't think you need the '!!' here.

Right, I guess since bool is a first class type in C9X we don't have
to worry about truncation. Old habits...

Rob

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ