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:   Mon, 6 Mar 2023 14:29:10 -0800
From:   Namhyung Kim <namhyung@...nel.org>
To:     Ravi Bangoria <ravi.bangoria@....com>
Cc:     peterz@...radead.org, eranian@...gle.com, acme@...nel.org,
        mark.rutland@....com, jolsa@...nel.org, irogers@...gle.com,
        bp@...en8.de, x86@...nel.org, linux-perf-users@...r.kernel.org,
        linux-kernel@...r.kernel.org, sandipan.das@....com,
        ananth.narayan@....com, santosh.shukla@....com
Subject: Re: [PATCH 1/2] perf/ibs: Fix interface via core pmu events

On Thu, Mar 2, 2023 at 9:54 PM Ravi Bangoria <ravi.bangoria@....com> wrote:
>
> Hi Namhyung,
>
> >> diff --git a/kernel/events/core.c b/kernel/events/core.c
> >> index a5a51dfdd622..c3f59d937280 100644
> >> --- a/kernel/events/core.c
> >> +++ b/kernel/events/core.c
> >> @@ -11633,9 +11633,13 @@ static struct pmu *perf_init_event(struct perf_event *event)
> >>                         goto fail;
> >>
> >>                 ret = perf_try_init_event(pmu, event);
> >> -               if (ret == -ENOENT && event->attr.type != type && !extended_type) {
> >> -                       type = event->attr.type;
> >> -                       goto again;
> >> +               if (ret == -ENOENT) {
> >> +                       if (event->attr.type != type && !extended_type) {
> >> +                               type = event->attr.type;
> >> +                               goto again;
> >> +                       }
> >> +                       if (pmu->capabilities & PERF_PMU_CAP_FORWARD_EVENT)
> >> +                               goto try_all;
> >
> > Wouldn't it be better to use a different error code to indicate
> > it's about precise_ip (or forwarding in general)?  Otherwise
> > other invalid config might cause the forwarding unnecessarily..
>
> That would make things easier and we might not need this new capability.
> Most appropriate error codes seems ENOENT, EOPNOTSUPP and EINVAL but all
> are already used for other purposes. Any other suggestions?

Maybe we can have more liberty for the error code since
it's not returned to the user.  How about ESRCH, EIO or ENXIO?

Thanks,
Namhyung

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ