Re: [PATCH 05/13] kallsyms: refactor {,module_}kallsyms_on_each_symbol

From: Miroslav Benes
Date: Tue Feb 02 2021 - 05:46:49 EST


On Mon, 1 Feb 2021, Christoph Hellwig wrote:

> On Mon, Feb 01, 2021 at 02:37:12PM +0100, Miroslav Benes wrote:
> > > > This change is not needed. (objname == NULL) means that we are
> > > > interested only in symbols in "vmlinux".
> > > >
> > > > module_kallsyms_on_each_symbol(klp_find_callback, &args)
> > > > will always fail when objname == NULL.
> > >
> > > I just tried to keep the old behavior. I can respin it with your
> > > recommended change noting the change in behavior, though.
> >
> > Yes, please. It would be cleaner that way.
>
> Let me know if this works for you:
>
> ---
> >From 18af41e88d088cfb8680d1669fcae2bc2ede5328 Mon Sep 17 00:00:00 2001
> From: Christoph Hellwig <hch@xxxxxx>
> Date: Wed, 20 Jan 2021 16:23:16 +0100
> Subject: kallsyms: refactor {,module_}kallsyms_on_each_symbol
>
> Require an explicit call to module_kallsyms_on_each_symbol to look
> for symbols in modules instead of the call from kallsyms_on_each_symbol,
> and acquire module_mutex inside of module_kallsyms_on_each_symbol instead
> of leaving that up to the caller. Note that this slightly changes the
> behavior for the livepatch code in that the symbols from vmlinux are not
> iterated anymore if objname is set, but that actually is the desired
> behavior in this case.
>
> Signed-off-by: Christoph Hellwig <hch@xxxxxx>

Acked-by: Miroslav Benes <mbenes@xxxxxxx>

Thanks Christoph

M