linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
To: "Bird, Tim" <Tim.Bird@sony.com>
Cc: "Jesper Dangaard Brouer" <brouer@redhat.com>,
	shuah <shuah@kernel.org>, "Daniel Díaz" <daniel.diaz@linaro.org>,
	"Andrii Nakryiko" <andrii.nakryiko@gmail.com>,
	"Andrii Nakryiko" <andriin@fb.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	BPF-dev-list <bpf@vger.kernel.org>,
	"Daniel Borkmann" <borkmann@iogearbox.net>,
	"David Miller" <davem@davemloft.net>,
	LKML <linux-kernel@vger.kernel.org>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Anders Roxell" <anders.roxell@linaro.org>,
	"Toke Høiland-Jørgensen" <toke@redhat.com>,
	"open list:KERNEL SELFTEST FRAMEWORK"
	<linux-kselftest@vger.kernel.org>
Subject: Re: Kernel 5.5.4 build fail for BPF-selftests with latest LLVM
Date: Thu, 20 Feb 2020 09:26:13 -0800	[thread overview]
Message-ID: <20200220172612.7aqmiwrnizgsukvm@ast-mbp> (raw)
In-Reply-To: <MWHPR13MB0895649219625C5F7380314FFD130@MWHPR13MB0895.namprd13.prod.outlook.com>

On Thu, Feb 20, 2020 at 05:02:25PM +0000, Bird, Tim wrote:
> 
> 
> > -----Original Message-----
> > From:  Jesper Dangaard Brouer
> > 
> > On Wed, 19 Feb 2020 17:47:23 -0700
> > shuah <shuah@kernel.org> wrote:
> > 
> > > On 2/19/20 5:27 PM, Alexei Starovoitov wrote:
> > > > On Wed, Feb 19, 2020 at 03:59:41PM -0600, Daniel Díaz wrote:
> > > >>>
> > > >>> When I download a specific kernel release, how can I know what LLVM
> > > >>> git-hash or version I need (to use BPF-selftests)?
> > > >
> > > > as discussed we're going to add documentation-like file that will
> > > > list required commits in tools.
> > > > This will be enforced for future llvm/pahole commits.
> > > >
> > > >>> Do you think it is reasonable to require end-users to compile their own
> > > >>> bleeding edge version of LLVM, to use BPF-selftests?
> > > >
> > > > absolutely.
> 
> Is it just the BPF-selftests that require the bleeding edge version of LLVM,
> or do BPF features themselves need the latest LLVM.  If the latter, then this
> is quite worrisome, and I fear the BPF developers are getting ahead of themselves.
> We don't usually have a kernel dependency on the latest compiler version (some
> recent security fixes are an anomaly).  In fact deprecating support for older compiler
> versions has been quite slow and methodical over the years.
> 
> It's quite dangerous to be baking stuff into the kernel that depends on features
> from compilers that haven't even made it to release yet.
> 
> I'm sorry, but I'm coming into the middle of this thread.  Can you please explain
> what the features are in the latest LLVM that are required for BPF-selftests?

Above is correct. bpf kernel features do depend on the latest pahole and llvm
features that did not make it into a release. That was the case for many years
now and still the case. The first commit 8 years ago relied on something that
can generate those instructions. For many years llvm was the only compiler that
could generate them. Right now there is GCC backend as well. New features (like
new instructions) depend on the compiler.

selftests/bpf are not testing kernel's bpf features. They are testing the whole
bpf ecosystem. They test llvm, pahole, libbpf, bpftool, and kernel together.
Hence it's a requirement to install the latest pahole and llvm.

When I'm talking about selftests/bpf I'm talking about all the tests in that
directory combined. There are several unit tests scattered across repos. The
unit tests for llvm bpf backend are inside llvm repo.
selftests/bpf/test_verifier and test_maps are unit tests for the verifier and
for maps. They are llvm independent. They test a combination of kernel and
libbpf only. But majority of the selftests/bpf are done via test_progs which
are the whole ecosystem tests.

  reply	other threads:[~2020-02-20 17:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200219133012.7cb6ac9e@carbon>
     [not found] ` <CAADnVQKQRKtDz0Boy=-cudc4eKGXB-yParGZv6qvYcQR4uMUQQ@mail.gmail.com>
     [not found]   ` <20200219180348.40393e28@carbon>
     [not found]     ` <CAEf4Bza9imKymHfv_LpSFE=kNB5=ZapTS3SCdeZsDdtrUrUGcg@mail.gmail.com>
     [not found]       ` <20200219192854.6b05b807@carbon>
     [not found]         ` <CAEf4BzaRAK6-7aCCVOA6hjTevKuxgvZZnHeVgdj_ZWNn8wibYQ@mail.gmail.com>
     [not found]           ` <20200219210609.20a097fb@carbon>
     [not found]             ` <CAEUSe79Vn8wr=BOh0RzccYij_snZDY=2XGmHmR494wsQBBoo5Q@mail.gmail.com>
     [not found]               ` <20200220002748.kpwvlz5xfmjm5fd5@ast-mbp>
2020-02-20  0:47                 ` Kernel 5.5.4 build fail for BPF-selftests with latest LLVM shuah
2020-02-20 16:37                   ` Jesper Dangaard Brouer
2020-02-20 17:02                     ` Bird, Tim
2020-02-20 17:26                       ` Alexei Starovoitov [this message]
2020-02-20 17:41                         ` Bird, Tim
2020-02-20 19:18                           ` Alexei Starovoitov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200220172612.7aqmiwrnizgsukvm@ast-mbp \
    --to=alexei.starovoitov@gmail.com \
    --cc=Tim.Bird@sony.com \
    --cc=anders.roxell@linaro.org \
    --cc=andrii.nakryiko@gmail.com \
    --cc=andriin@fb.com \
    --cc=borkmann@iogearbox.net \
    --cc=bpf@vger.kernel.org \
    --cc=brouer@redhat.com \
    --cc=daniel.diaz@linaro.org \
    --cc=davem@davemloft.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=shuah@kernel.org \
    --cc=toke@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).