Linux-Modules Archive mirror
 help / color / mirror / Atom feed
From: Kris Van Hees <kris.van.hees@oracle.com>
To: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Kris Van Hees <kris.van.hees@oracle.com>,
	linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org,
	linux-modules@vger.kernel.org,
	linux-trace-kernel@vger.kernel.org,
	Nick Alcock <nick.alcock@oracle.com>,
	Alan Maguire <alan.maguire@oracle.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Luis Chamberlain <mcgrof@kernel.org>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Jiri Olsa <olsajiri@gmail.com>
Subject: Re: [PATCH 2/6] module: add CONFIG_BUILTIN_RANGES option
Date: Mon, 11 Dec 2023 11:29:54 -0500	[thread overview]
Message-ID: <ZXcntGeMdn0/1V9F@oracle.com> (raw)
In-Reply-To: <20231209075917.833c8f1ae78172dbb1d83b97@kernel.org>

On Sat, Dec 09, 2023 at 07:59:17AM +0900, Masami Hiramatsu wrote:
> On Fri,  8 Dec 2023 00:07:48 -0500
> Kris Van Hees <kris.van.hees@oracle.com> wrote:
> 
> > The CONFIG_BUILTIN_RANGES option controls whether offset range data is
> > generated for kernel modules that are built into the kernel image.
> > 
> > Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
> > Reviewed-by: Nick Alcock <nick.alcock@oracle.com>
> > Reviewed-by: Alan Maguire <alan.maguire@oracle.com>
> > ---
> >  kernel/module/Kconfig | 17 +++++++++++++++++
> >  1 file changed, 17 insertions(+)
> > 
> > diff --git a/kernel/module/Kconfig b/kernel/module/Kconfig
> > index 33a2e991f608..0798439b11ac 100644
> > --- a/kernel/module/Kconfig
> > +++ b/kernel/module/Kconfig
> > @@ -389,4 +389,21 @@ config MODULES_TREE_LOOKUP
> >  	def_bool y
> >  	depends on PERF_EVENTS || TRACING || CFI_CLANG
> >  
> > +config BUILTIN_RANGES
> 
> BUILTIN_MODULE_RANGES ?

Ah yes, thank you.  Will fix in v2.

> BTW, even if CONFIG_MODULES=n, we can embed the kernel module code.
> So should this visible if the CONFIG_MODULES=n ?

That is a very good point.  And in that case, the ranges information should
still be produced when this option is set.  I will move the option to a more
appropriate location, not depending on CONFIG_MODULES.

> Thank you,

Thank you for your feedback!

> > +	bool "Generate address range information for builtin modules"
> > +	depends on VMLINUX_MAP
> > +	help
> > +	  When modules are built into the kernel, there will be no module name
> > +	  associated with its symbols in /proc/kallsyms.  Tracers may want to
> > +	  identify symbols by module name and symbol name regardless of whether
> > +	  the module is configured as loadable or not.
> > +
> > +	  This option generates modules.builtin.ranges in the build tree with
> > +	  offset ranges (per ELF section) for the module(s) they belong to.
> > +	  It also records an anchor symbol to determine the load address of the
> > +	  section.
> > +
> > +	  It is fully compatible with CONFIG_RANDOMIZE_BASE and similar late-
> > +	  address-modification options.
> > +
> >  endif # MODULES
> > -- 
> > 2.42.0
> > 
> 
> 
> -- 
> Masami Hiramatsu (Google) <mhiramat@kernel.org>

  reply	other threads:[~2023-12-11 16:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-08  5:07 [PATCH 0/6] Generate address range data for built-in modules Kris Van Hees
2023-12-08  5:07 ` [PATCH 1/6] kbuild: add modules.builtin.objs Kris Van Hees
2023-12-08  5:07 ` [PATCH 2/6] module: add CONFIG_BUILTIN_RANGES option Kris Van Hees
2023-12-08 22:59   ` Masami Hiramatsu
2023-12-11 16:29     ` Kris Van Hees [this message]
2023-12-08  5:07 ` [PATCH 3/6] kbuild: generate a linker map for vmlinux.o Kris Van Hees
2023-12-08  5:07 ` [PATCH 4/6] module: script to generate offset ranges for builtin modules Kris Van Hees
2023-12-08  5:07 ` [PATCH 5/6] kbuild: generate modules.builtin.ranges when linking the kernel Kris Van Hees
2023-12-08  5:07 ` [PATCH 6/6] module: add install target for modules.builtin.ranges Kris Van Hees

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=ZXcntGeMdn0/1V9F@oracle.com \
    --to=kris.van.hees@oracle.com \
    --cc=alan.maguire@oracle.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-modules@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=nick.alcock@oracle.com \
    --cc=olsajiri@gmail.com \
    --cc=rostedt@goodmis.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 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 read-only IMAP folder(s) and NNTP newsgroup(s).