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

2021-02-03 Thread Petr Mladek
On Tue 2021-02-02 13:13:26, Christoph Hellwig wrote: > 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

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

2021-02-02 Thread Christoph Hellwig
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

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

2021-02-02 Thread Miroslav Benes
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,

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

2021-02-01 Thread Christoph Hellwig
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, ) > > > will always fail when objname == NULL. > > > >

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

2021-02-01 Thread Miroslav Benes
One more thing... > @@ -4379,8 +4379,7 @@ int module_kallsyms_on_each_symbol(int (*fn)(void *, > const char *, > unsigned int i; > int ret; > > - module_assert_mutex(); > - > + mutex_lock(_mutex); > list_for_each_entry(mod, , list) { > /* We hold

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

2021-02-01 Thread Miroslav Benes
On Mon, 1 Feb 2021, Christoph Hellwig wrote: > On Fri, Jan 29, 2021 at 10:43:36AM +0100, Petr Mladek wrote: > > > --- a/kernel/livepatch/core.c > > > +++ b/kernel/livepatch/core.c > > > @@ -164,12 +164,8 @@ static int klp_find_object_symbol(const char > > > *objname, const char *name, > > >

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

2021-02-01 Thread Christoph Hellwig
On Fri, Jan 29, 2021 at 10:43:36AM +0100, Petr Mladek wrote: > > --- a/kernel/livepatch/core.c > > +++ b/kernel/livepatch/core.c > > @@ -164,12 +164,8 @@ static int klp_find_object_symbol(const char *objname, > > const char *name, > > .pos = sympos, > > }; > > > > -

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

2021-01-21 Thread Christoph Hellwig
Require an explicit cll 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. Signed-off-by: Christoph Hellwig ---