All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joel Fernandes <joel@joelfernandes.org>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: linux-kernel@vger.kernel.org, alexei.starovoitov@gmail.com
Subject: Re: [PATCH v2 1/2] Provide in-kernel headers for making it easy to extend the kernel
Date: Tue, 19 Feb 2019 12:25:50 -0500	[thread overview]
Message-ID: <20190219172550.GB239374@google.com> (raw)
In-Reply-To: <20190219060531.GA3263@avx2>

On Tue, Feb 19, 2019 at 09:05:31AM +0300, Alexey Dobriyan wrote:
> > /proc/kheaders.txz
> 
> This is gross.

It is a bit gross, but it solves a long standing problem we have nicely. And
there's also /proc/config.gz.

> > The feature is also buildable as a module just in case the user desires
> > it not being part of the kernel image. This makes it possible to load
> > and unload the headers on demand. A tracing program, or a kernel module
> > builder can load the module, do its operations, and then unload the
> > module to save kernel memory.
> 
> Please explain how keeping headers on the filesystem is not OK due
> to "licensing and other issues" but keeping a module on the filesystem
> is OK.

In the Android ecosystem, the Android teams only provide a "userspace system
image" which goes on the system partition of the flash. This image is not GPL
and doesn't contain anything GPL. It is thus not possible to put kernel
headers on the system image and I already had many discussions on the subject
with the teams, it is something that is just not done. Now for kernel
modules, there's another image called the "vendor image" which is flashed
onto the vendor parition, this is where kernel modules go. This vendor image
is not provided by Google for non-Pixel devices. So we have no control over
what goes there. We do know that kernel modules that are enabled will go
there, and we do have control over enforcing that certain kernel modules
should be built and available as they are mandatory for Android to function
properly (and we can enforce this as a case of Android device compliance).

So this solves the problem rather nicely. It is also useful for non-Android
usecases where a linux-headers package needs to be installed for tracing
programs. With this feature, such a package install step is not needed.

> > > I can route it via bpf-next tree if there are no objections.
> 
> Please don't.

Why not? You do know that eBPF based compilation needs to process kernel
headers to build the eBPF program? This was primarily inspired by problems
with getting eBPF to work, but it also applies to other trace tools like
systemtap that build for a module backend. In fact for Android, I am planning
to have facilities to compile code for a module backend as well.

> IKHD_ST IKHD_ED are bogus artifacts as others mentioned.
> proc_create(S_IFREG) is redundant.
> seq_file.h is not needed as is THIS_MODULE.
> I'd say such data should live in their own section for easy extraction
> with "objdump -j", something /proc/config.gz never did.

Thanks for the suggestions, I will look into these and refresh my series. My
first priority right now is to make incremental builds work. Other than
these, other changes are mostly cosmetic so I can address them after. Of
course I will address everything before posting again.

 - Joel


  reply	other threads:[~2019-02-19 17:25 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-19  6:05 [PATCH v2 1/2] Provide in-kernel headers for making it easy to extend the kernel Alexey Dobriyan
2019-02-19 17:25 ` Joel Fernandes [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-02-11 14:35 Joel Fernandes (Google)
2019-02-11 14:35 ` Joel Fernandes (Google)
2019-02-11 14:35 ` joel
2019-02-13 22:50 ` Karim Yaghmour
2019-02-13 22:50   ` Karim Yaghmour
2019-02-13 22:50   ` karim.yaghmour
2019-02-15  3:19 ` Alexei Starovoitov
2019-02-15  3:19   ` Alexei Starovoitov
2019-02-15  3:19   ` alexei.starovoitov
2019-02-15  3:47   ` Joel Fernandes
2019-02-15  3:47     ` Joel Fernandes
2019-02-15  3:47     ` joel
2019-02-16 19:10     ` Manoj
2019-02-16 19:10       ` Manoj
2019-02-16 19:10       ` linux
2019-02-19  4:14   ` Masahiro Yamada
2019-02-19  4:14     ` Masahiro Yamada
2019-02-19  4:14     ` yamada.masahiro
2019-02-19  4:28     ` Alexei Starovoitov
2019-02-19  4:28       ` Alexei Starovoitov
2019-02-19  4:28       ` alexei.starovoitov
2019-02-19  4:34     ` Joel Fernandes
2019-02-19  4:34       ` Joel Fernandes
2019-02-19  4:34       ` joel
2019-02-19  4:42     ` Masahiro Yamada
2019-02-19  4:42       ` Masahiro Yamada
2019-02-19  4:42       ` yamada.masahiro
2019-02-19  5:12       ` Joel Fernandes
2019-02-19  5:12         ` Joel Fernandes
2019-02-19  5:12         ` joel
2019-02-19 15:16       ` Joel Fernandes
2019-02-19 15:16         ` Joel Fernandes
2019-02-19 15:16         ` joel
2019-02-21 14:34         ` Masahiro Yamada
2019-02-21 14:34           ` Masahiro Yamada
2019-02-21 14:34           ` yamada.masahiro
2019-02-21 15:29           ` Joel Fernandes
2019-02-21 15:29             ` Joel Fernandes
2019-02-21 15:29             ` joel
2019-03-25 13:49   ` Joel Fernandes
2019-03-25 13:49     ` Joel Fernandes
2019-03-25 13:49     ` joel
2019-03-27 17:31     ` Joel Fernandes
2019-03-27 17:31       ` Joel Fernandes
2019-03-27 17:31       ` joel
2019-04-03  7:48       ` Masahiro Yamada
2019-04-03  7:48         ` Masahiro Yamada
2019-04-03  7:48         ` yamada.masahiro
2019-04-03 17:20         ` Joel Fernandes
2019-04-03 17:20           ` Joel Fernandes
2019-04-03 17:20           ` joel
2019-04-03 17:46           ` Daniel Colascione
2019-04-03 17:46             ` Daniel Colascione
2019-04-03 17:46             ` dancol
2019-04-03 17:56             ` Joel Fernandes
2019-04-03 17:56               ` Joel Fernandes
2019-04-03 17:56               ` joel
2019-04-04  3:54               ` Masahiro Yamada
2019-04-04  3:54                 ` Masahiro Yamada
2019-04-04  3:54                 ` yamada.masahiro

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=20190219172550.GB239374@google.com \
    --to=joel@joelfernandes.org \
    --cc=adobriyan@gmail.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.