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]
Date:   Tue, 7 Mar 2023 08:52:57 -0800
From:   Namhyung Kim <namhyung@...nel.org>
To:     Ian Rogers <irogers@...gle.com>
Cc:     bpf@...r.kernel.org, Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Jiri Olsa <jolsa@...nel.org>,
        Martin KaFai Lau <martin.lau@...nel.org>,
        linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] perf lock contention: Fix builtin detection

On Mon, Mar 6, 2023 at 9:56 PM Ian Rogers <irogers@...gle.com> wrote:
>
> On Mon, Mar 6, 2023 at 8:43 PM Namhyung Kim <namhyung@...nel.org> wrote:
> >
> > Hi Ian,
> >
> > On Mon, Mar 6, 2023 at 7:21 PM Ian Rogers <irogers@...gle.com> wrote:
> > >
> > > __has_builtin was passed the macro rather than the actual builtin
> > > feature.
> >
> > Oh, I missed it's a macro define in tools/lib/bpf/bpf_core_read.h file.
> >
> > Looking at some BPF test codes, it seems you also need to check the
> > clang compiler version.  Please take a look at the file below:
> >
> >   tools/testing/selftests/bpf/progs/test_core_reloc_type_base.c
> >
> > Thanks,
> > Namhyung
>
> Hmm..
>
> tools/testing/selftests/bpf/progs/test_core_reloc_kernel.c:
> ...
>        /* Support for the BPF_TYPE_MATCHES argument to the
>         * __builtin_preserve_type_info builtin was added at some point during
>         * development of clang 15 and it's what we require for this test.
>         */
> #if __has_builtin(__builtin_preserve_type_info) && __clang_major__ >= 15
> ...
>
> I'm not sure we need to worry about development clang builds and just
> the __has_builtin is cleaner. Perhaps the BPF folks can chime in.

My understanding is that __builtin_preserve_type_info is supported
before.  But clang 15 added BPF_TYPE_MATCHES which is used for
bpf_core_type_matches().  So just checking the builtin would not work.

Thanks,
Namhyung

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ