bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rafael David Tinoco <rafaeldtinoco@ubuntu.com>
To: Daniel Borkmann <daniel@iogearbox.net>
Cc: Andrii Nakryiko <andrii.nakryiko@gmail.com>, bpf <bpf@vger.kernel.org>
Subject: Re: [PATCH] libbpf: allow bpf object kern_version to be overridden
Date: Fri, 19 Mar 2021 01:38:47 -0300	[thread overview]
Message-ID: <BBAD5B1E-7FD1-46BC-A626-EA6ADD737ED6@ubuntu.com> (raw)
In-Reply-To: <318f936b-2f7c-7d4a-cb40-baf673bd6c9e@iogearbox.net>

>>>
>>> This will also help portable binaries within similar older kernels, as
>>> long as they have their BTF data converted from DWARVES (for example).
>>>
>>> Signed-off-by: Rafael David Tinoco <rafaeldtinoco@ubuntu.com>
>>> ---
>> Libbpf currently provides a way to specify custom kernel version using
>> a special "version" ELF section:
>> int _version SEC("version") = 123;
>> But it seems like you would want to set it at runtime, so this
>> compile-time approach might be problematic. But instead of hijacking
>> get_kernel_version(), it's better to add a simple setter counterpart
>> to bpf_object__kversion() that would just override obj->kern_version.
>
> +1, agree, setter makes sense for old kernels, so the loader app can set/
> retrieve from wherever it's needed. In addition, couldn't you also backport
> the old commit that ignores the kern_version from kernel side (won't help
> existing users, but at least might simplify things once they start  
> upgrade)?

Yep :\ that was my initial approach and I went for something simpler.
Will propose something else. Once I finish this, I’ll propose the
back-ports removing the version check to the kernel team. Not having
the attr version check will definitely help this, for now needed,
mitigation to fade away.

Thanks for the reviews, would appreciate comments on:

[RFC][PATCH] libbpf: support kprobe/kretprobe events in legacy environments

if possible, as both walk together supporting legacy kernels.

tks
-rafaeldtinoco

  reply	other threads:[~2021-03-19  4:39 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-18  6:25 [RFC][PATCH] libbpf: support kprobe/kretprobe events in legacy environments Rafael David Tinoco
2021-03-18 19:31 ` [PATCH] libbpf: allow bpf object kern_version to be overridden Rafael David Tinoco
2021-03-18 19:46   ` Andrii Nakryiko
2021-03-18 20:56     ` Daniel Borkmann
2021-03-19  4:38       ` Rafael David Tinoco [this message]
2021-03-19  4:51 ` [RFC][PATCH] libbpf: support kprobe/kretprobe events in legacy environments Andrii Nakryiko
2021-03-22 18:04   ` [PATCH v2 bpf-next][RFC] libbpf: introduce legacy kprobe events support Rafael David Tinoco
2021-03-22 18:25     ` Rafael David Tinoco
2021-03-26 20:50       ` Andrii Nakryiko
2021-04-07  4:49         ` Rafael David Tinoco
2021-04-07 22:33           ` Andrii Nakryiko
2021-04-08 23:59             ` John Fastabend
2021-04-14 14:30             ` Rafael David Tinoco
2021-04-14 20:06               ` Rafael David Tinoco
2021-04-14 23:23               ` Andrii Nakryiko
2021-04-15  5:53                 ` Rafael David Tinoco
2021-04-15 22:48                   ` Andrii Nakryiko
2021-06-25  4:44                 ` [PATCH bpf-next v3] " Rafael David Tinoco
2021-06-25  5:01                   ` Rafael David Tinoco
2021-07-07 13:38                   ` Rafael David Tinoco
2021-07-07 21:52                   ` Andrii Nakryiko
2021-07-19  1:59                     ` Rafael David Tinoco
2021-07-20  0:10                       ` Andrii Nakryiko
2021-07-20  4:16                         ` Rafael David Tinoco

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=BBAD5B1E-7FD1-46BC-A626-EA6ADD737ED6@ubuntu.com \
    --to=rafaeldtinoco@ubuntu.com \
    --cc=andrii.nakryiko@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    /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).