LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Gianluca Borello <g.borello@gmail.com>
To: bp@alien8.de
Cc: Alexei Starovoitov <alexei.starovoitov@gmail.com>,
	peterz@infradead.org, Yonghong Song <yhs@fb.com>,
	mingo@kernel.org, torvalds@linux-foundation.org,
	Alexei Starovoitov <ast@fb.com>,
	Daniel Borkmann <daniel@iogearbox.net>,
	linux-kernel@vger.kernel.org, x86@kernel.org,
	Linux Networking Development Mailing List
	<netdev@vger.kernel.org>,
	kernel-team@fb.com, tglx@linutronix.de
Subject: Re: [PATCH bpf v3] x86/cpufeature: bpf hack for clang not supporting asm goto
Date: Thu, 10 May 2018 17:57:43 +0000	[thread overview]
Message-ID: <CAJWsiu=6gNzepWSvySZvmLsRckLE0kpYEFAave0HUJdDSjf9FQ@mail.gmail.com> (raw)
In-Reply-To: <20180510162028.GB16130@pd.tnic>

On Thu, May 10, 2018 at 9:28 AM Borislav Petkov <bp@alien8.de> wrote:

> As someone already pointed out on IRC, arch/x86/include/asm/cpufeature.h
> is solely a kernel header so nothing but kernel should include it. So
> forget the userspace breakage "argument".


For what is worth, I have the same exact problem in a relatively popular
open source system call tracer, and my attempt to fix the issue from user
space has been:
https://github.com/draios/sysdig/commit/2958eb1d52e047f4b93d1238be803e7c405bdec2

While I can definitely live with that (and I'd be happy to submit a patch
to samples/ following the same approach) and absolutely respect the
technical authority of the reviewers here, it would be nice to recognize
that these changes actually affect users to a certain degree, even if from
a technical point of view they don't break userspace.

 From a practical point of view, BPF is widely used from userspace programs
to access some kernel data structures to gather visibility information, and
even the simplest use case, such as including linux/sched.h to access some
task_struct members, ends up pulling in arch/x86/include/asm/cpufeature.h,
thus (ab)using that file. Adding these quirks definitely increases the
complexity a developer needs to keep in mind in order to take advantage of
a BPF based instrumentation.

Thanks

  reply	other threads:[~2018-05-10 17:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-04  3:31 Yonghong Song
2018-05-10 10:06 ` Peter Zijlstra
2018-05-10 15:52   ` Alexei Starovoitov
2018-05-10 16:20     ` Borislav Petkov
2018-05-10 17:57       ` Gianluca Borello [this message]
2018-05-10 17:58       ` Alexei Starovoitov
2018-05-10 18:16         ` Borislav Petkov
2018-05-10 10:49 ` Borislav Petkov
2018-05-12 16:03 Alexei Starovoitov
2018-05-12 20:30 ` Thomas Gleixner
2018-05-13 17:43   ` Alexei Starovoitov
2018-05-13 18:02     ` Thomas Gleixner

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='CAJWsiu=6gNzepWSvySZvmLsRckLE0kpYEFAave0HUJdDSjf9FQ@mail.gmail.com' \
    --to=g.borello@gmail.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=ast@fb.com \
    --cc=bp@alien8.de \
    --cc=daniel@iogearbox.net \
    --cc=kernel-team@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=x86@kernel.org \
    --cc=yhs@fb.com \
    --subject='Re: [PATCH bpf v3] x86/cpufeature: bpf hack for clang not supporting asm goto' \
    /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

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).