linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] module: add stub for within_module
@ 2019-04-07  2:25 Tri Vo
  2019-04-08 18:08 ` Nick Desaulniers
  0 siblings, 1 reply; 10+ messages in thread
From: Tri Vo @ 2019-04-07  2:25 UTC (permalink / raw)
  To: oberpar, akpm, jeyu
  Cc: ndesaulniers, ghackmann, linux-mm, kbuild-all, rdunlap, lkp,
	linux-kernel, pgynther, willy, Tri Vo

Provide a stub for within_module() when CONFIG_MODULES is not set. This
is needed to build CONFIG_GCOV_KERNEL.

Fixes: 8c3d220cb6b5 ("gcov: clang support")
Suggested-by: Matthew Wilcox <willy@infradead.org>
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Reported-by: kbuild test robot <lkp@intel.com>
Link: https://marc.info/?l=linux-mm&m=155384681109231&w=2
Signed-off-by: Tri Vo <trong@android.com>
---
 include/linux/module.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/linux/module.h b/include/linux/module.h
index 5bf5dcd91009..47190ebb70bf 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -709,6 +709,11 @@ static inline bool is_module_text_address(unsigned long addr)
 	return false;
 }
 
+static inline bool within_module(unsigned long addr, const struct module *mod)
+{
+	return false;
+}
+
 /* Get/put a kernel symbol (calls should be symmetric) */
 #define symbol_get(x) ({ extern typeof(x) x __attribute__((weak)); &(x); })
 #define symbol_put(x) do { } while (0)
-- 
2.21.0.392.gf8f6787159e-goog


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] module: add stub for within_module
  2019-04-07  2:25 [PATCH] module: add stub for within_module Tri Vo
@ 2019-04-08 18:08 ` Nick Desaulniers
  2019-04-08 18:11   ` Nick Desaulniers
  2019-04-15 14:22   ` Jessica Yu
  0 siblings, 2 replies; 10+ messages in thread
From: Nick Desaulniers @ 2019-04-08 18:08 UTC (permalink / raw)
  To: Tri Vo, Jessica Yu, Matthew Wilcox, Randy Dunlap
  Cc: Peter Oberparleiter, Andrew Morton, Greg Hackmann,
	Linux Memory Management List, kbuild-all, kbuild test robot,
	LKML, Petri Gynther

On Sat, Apr 6, 2019 at 7:26 PM Tri Vo <trong@android.com> wrote:
>
> Provide a stub for within_module() when CONFIG_MODULES is not set. This
> is needed to build CONFIG_GCOV_KERNEL.
>
> Fixes: 8c3d220cb6b5 ("gcov: clang support")

The above commit got backed out of the -mm tree, due to the issue this
patch addresses, so not sure it provides the correct context for the
patch.  Maybe that line in the commit message should be dropped?

> Suggested-by: Matthew Wilcox <willy@infradead.org>
> Reported-by: Randy Dunlap <rdunlap@infradead.org>
> Reported-by: kbuild test robot <lkp@intel.com>
> Link: https://marc.info/?l=linux-mm&m=155384681109231&w=2
> Signed-off-by: Tri Vo <trong@android.com>
> ---
>  include/linux/module.h | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/include/linux/module.h b/include/linux/module.h
> index 5bf5dcd91009..47190ebb70bf 100644
> --- a/include/linux/module.h
> +++ b/include/linux/module.h
> @@ -709,6 +709,11 @@ static inline bool is_module_text_address(unsigned long addr)
>         return false;
>  }
>
> +static inline bool within_module(unsigned long addr, const struct module *mod)
> +{
> +       return false;
> +}
> +

Do folks think that similar stubs for within_module_core and
within_module_init should be added, while we're here?

It looks like kernel/trace/ftrace.c uses them, but has proper
CONFIG_MODULE guards.

>  /* Get/put a kernel symbol (calls should be symmetric) */
>  #define symbol_get(x) ({ extern typeof(x) x __attribute__((weak)); &(x); })
>  #define symbol_put(x) do { } while (0)
> --
> 2.21.0.392.gf8f6787159e-goog
>


-- 
Thanks,
~Nick Desaulniers

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] module: add stub for within_module
  2019-04-08 18:08 ` Nick Desaulniers
@ 2019-04-08 18:11   ` Nick Desaulniers
  2019-04-15 14:22   ` Jessica Yu
  1 sibling, 0 replies; 10+ messages in thread
From: Nick Desaulniers @ 2019-04-08 18:11 UTC (permalink / raw)
  To: Tri Vo, Jessica Yu, Matthew Wilcox, Randy Dunlap
  Cc: Peter Oberparleiter, Andrew Morton, Greg Hackmann,
	Linux Memory Management List, kbuild-all, kbuild test robot,
	LKML, Petri Gynther

On Mon, Apr 8, 2019 at 11:08 AM Nick Desaulniers
<ndesaulniers@google.com> wrote:
>
> On Sat, Apr 6, 2019 at 7:26 PM Tri Vo <trong@android.com> wrote:
> >
> > Provide a stub for within_module() when CONFIG_MODULES is not set. This
> > is needed to build CONFIG_GCOV_KERNEL.
> >
> > Fixes: 8c3d220cb6b5 ("gcov: clang support")
>
> The above commit got backed out of the -mm tree, due to the issue this
> patch addresses, so not sure it provides the correct context for the
> patch.  Maybe that line in the commit message should be dropped?

Maybe Jessica could drop that if/when applying?

>
> > Suggested-by: Matthew Wilcox <willy@infradead.org>
> > Reported-by: Randy Dunlap <rdunlap@infradead.org>
> > Reported-by: kbuild test robot <lkp@intel.com>
> > Link: https://marc.info/?l=linux-mm&m=155384681109231&w=2
> > Signed-off-by: Tri Vo <trong@android.com>
> > ---
> >  include/linux/module.h | 5 +++++
> >  1 file changed, 5 insertions(+)
> >
> > diff --git a/include/linux/module.h b/include/linux/module.h
> > index 5bf5dcd91009..47190ebb70bf 100644
> > --- a/include/linux/module.h
> > +++ b/include/linux/module.h
> > @@ -709,6 +709,11 @@ static inline bool is_module_text_address(unsigned long addr)
> >         return false;
> >  }
> >
> > +static inline bool within_module(unsigned long addr, const struct module *mod)
> > +{
> > +       return false;
> > +}
> > +
>
> Do folks think that similar stubs for within_module_core and
> within_module_init should be added, while we're here?
>

Otherwise, if the answer to the above is no,
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>

-- 
Thanks,
~Nick Desaulniers

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] module: add stub for within_module
  2019-04-08 18:08 ` Nick Desaulniers
  2019-04-08 18:11   ` Nick Desaulniers
@ 2019-04-15 14:22   ` Jessica Yu
  2019-04-15 18:18     ` [PATCH v2] module: add stubs for within_module functions Tri Vo
  1 sibling, 1 reply; 10+ messages in thread
From: Jessica Yu @ 2019-04-15 14:22 UTC (permalink / raw)
  To: Nick Desaulniers
  Cc: Tri Vo, Matthew Wilcox, Randy Dunlap, Peter Oberparleiter,
	Andrew Morton, Greg Hackmann, Linux Memory Management List,
	kbuild-all, kbuild test robot, LKML, Petri Gynther

+++ Nick Desaulniers [08/04/19 11:08 -0700]:
>On Sat, Apr 6, 2019 at 7:26 PM Tri Vo <trong@android.com> wrote:
>>
>> Provide a stub for within_module() when CONFIG_MODULES is not set. This
>> is needed to build CONFIG_GCOV_KERNEL.
>>
>> Fixes: 8c3d220cb6b5 ("gcov: clang support")
>
>The above commit got backed out of the -mm tree, due to the issue this
>patch addresses, so not sure it provides the correct context for the
>patch.  Maybe that line in the commit message should be dropped?

Yeah, if the commit is no longer valid, then we should drop this line
and perhaps generalize the commit message more, maybe something like
"provide a stub for within_module() to prevent build errors when 
!CONFIG_MODULES".

>> Suggested-by: Matthew Wilcox <willy@infradead.org>
>> Reported-by: Randy Dunlap <rdunlap@infradead.org>
>> Reported-by: kbuild test robot <lkp@intel.com>
>> Link: https://marc.info/?l=linux-mm&m=155384681109231&w=2
>> Signed-off-by: Tri Vo <trong@android.com>
>> ---
>>  include/linux/module.h | 5 +++++
>>  1 file changed, 5 insertions(+)
>>
>> diff --git a/include/linux/module.h b/include/linux/module.h
>> index 5bf5dcd91009..47190ebb70bf 100644
>> --- a/include/linux/module.h
>> +++ b/include/linux/module.h
>> @@ -709,6 +709,11 @@ static inline bool is_module_text_address(unsigned long addr)
>>         return false;
>>  }
>>
>> +static inline bool within_module(unsigned long addr, const struct module *mod)
>> +{
>> +       return false;
>> +}
>> +
>
>Do folks think that similar stubs for within_module_core and
>within_module_init should be added, while we're here?
>
>It looks like kernel/trace/ftrace.c uses them, but has proper
>CONFIG_MODULE guards.

Tri, if you plan on sending a v2, could you add Nick's suggestion
above? Would probably be good to prevent future build errors if a user
omits CONFIG_MODULE guards.

Thanks,

Jessica


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v2] module: add stubs for within_module functions
  2019-04-15 14:22   ` Jessica Yu
@ 2019-04-15 18:18     ` Tri Vo
  2019-04-16 15:21       ` Jessica Yu
  0 siblings, 1 reply; 10+ messages in thread
From: Tri Vo @ 2019-04-15 18:18 UTC (permalink / raw)
  To: jeyu
  Cc: ndesaulniers, ghackmann, linux-mm, kbuild-all, rdunlap, lkp,
	linux-kernel, pgynther, willy, oberpar, akpm, Tri Vo

Provide stubs for within_module_core(), within_module_init(), and
within_module() to prevent build errors when !CONFIG_MODULES.

v2:
- Generalized commit message, as per Jessica.
- Stubs for within_module_core() and within_module_init(), as per Nick.

Suggested-by: Matthew Wilcox <willy@infradead.org>
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Reported-by: kbuild test robot <lkp@intel.com>
Link: https://marc.info/?l=linux-mm&m=155384681109231&w=2
Signed-off-by: Tri Vo <trong@android.com>
---
 include/linux/module.h | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/include/linux/module.h b/include/linux/module.h
index 5bf5dcd91009..35d83765bfbd 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -709,6 +709,23 @@ static inline bool is_module_text_address(unsigned long addr)
 	return false;
 }
 
+static inline bool within_module_core(unsigned long addr,
+				      const struct module *mod)
+{
+	return false;
+}
+
+static inline bool within_module_init(unsigned long addr,
+				      const struct module *mod)
+{
+	return false;
+}
+
+static inline bool within_module(unsigned long addr, const struct module *mod)
+{
+	return false;
+}
+
 /* Get/put a kernel symbol (calls should be symmetric) */
 #define symbol_get(x) ({ extern typeof(x) x __attribute__((weak)); &(x); })
 #define symbol_put(x) do { } while (0)
-- 
2.21.0.392.gf8f6787159e-goog


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH v2] module: add stubs for within_module functions
  2019-04-15 18:18     ` [PATCH v2] module: add stubs for within_module functions Tri Vo
@ 2019-04-16 15:21       ` Jessica Yu
  2019-04-16 17:55         ` Tri Vo
  0 siblings, 1 reply; 10+ messages in thread
From: Jessica Yu @ 2019-04-16 15:21 UTC (permalink / raw)
  To: Tri Vo
  Cc: ndesaulniers, ghackmann, linux-mm, kbuild-all, rdunlap, lkp,
	linux-kernel, pgynther, willy, oberpar, akpm

+++ Tri Vo [15/04/19 11:18 -0700]:
>Provide stubs for within_module_core(), within_module_init(), and
>within_module() to prevent build errors when !CONFIG_MODULES.
>
>v2:
>- Generalized commit message, as per Jessica.
>- Stubs for within_module_core() and within_module_init(), as per Nick.
>
>Suggested-by: Matthew Wilcox <willy@infradead.org>
>Reported-by: Randy Dunlap <rdunlap@infradead.org>
>Reported-by: kbuild test robot <lkp@intel.com>
>Link: https://marc.info/?l=linux-mm&m=155384681109231&w=2
>Signed-off-by: Tri Vo <trong@android.com>

Applied, thanks!

Jessica


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2] module: add stubs for within_module functions
  2019-04-16 15:21       ` Jessica Yu
@ 2019-04-16 17:55         ` Tri Vo
  2019-04-16 18:56           ` Tri Vo
  0 siblings, 1 reply; 10+ messages in thread
From: Tri Vo @ 2019-04-16 17:55 UTC (permalink / raw)
  To: Jessica Yu
  Cc: Nick Desaulniers, Greg Hackmann, linux-mm, kbuild-all,
	Randy Dunlap, kbuild test robot, LKML, Petri Gynther, willy,
	Peter Oberparleiter, Andrew Morton

On Tue, Apr 16, 2019 at 8:21 AM Jessica Yu <jeyu@kernel.org> wrote:
>
> +++ Tri Vo [15/04/19 11:18 -0700]:
> >Provide stubs for within_module_core(), within_module_init(), and
> >within_module() to prevent build errors when !CONFIG_MODULES.
> >
> >v2:
> >- Generalized commit message, as per Jessica.
> >- Stubs for within_module_core() and within_module_init(), as per Nick.
> >
> >Suggested-by: Matthew Wilcox <willy@infradead.org>
> >Reported-by: Randy Dunlap <rdunlap@infradead.org>
> >Reported-by: kbuild test robot <lkp@intel.com>
> >Link: https://marc.info/?l=linux-mm&m=155384681109231&w=2
> >Signed-off-by: Tri Vo <trong@android.com>
>
> Applied, thanks!

Thank you!

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2] module: add stubs for within_module functions
  2019-04-16 17:55         ` Tri Vo
@ 2019-04-16 18:56           ` Tri Vo
  2019-04-16 21:38             ` Andrew Morton
  0 siblings, 1 reply; 10+ messages in thread
From: Tri Vo @ 2019-04-16 18:56 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Nick Desaulniers, Greg Hackmann, linux-mm, kbuild-all,
	Randy Dunlap, kbuild test robot, LKML, Petri Gynther, willy,
	Peter Oberparleiter, Jessica Yu

On Tue, Apr 16, 2019 at 10:55 AM Tri Vo <trong@android.com> wrote:
>
> On Tue, Apr 16, 2019 at 8:21 AM Jessica Yu <jeyu@kernel.org> wrote:
> >
> > +++ Tri Vo [15/04/19 11:18 -0700]:
> > >Provide stubs for within_module_core(), within_module_init(), and
> > >within_module() to prevent build errors when !CONFIG_MODULES.
> > >
> > >v2:
> > >- Generalized commit message, as per Jessica.
> > >- Stubs for within_module_core() and within_module_init(), as per Nick.
> > >
> > >Suggested-by: Matthew Wilcox <willy@infradead.org>
> > >Reported-by: Randy Dunlap <rdunlap@infradead.org>
> > >Reported-by: kbuild test robot <lkp@intel.com>
> > >Link: https://marc.info/?l=linux-mm&m=155384681109231&w=2
> > >Signed-off-by: Tri Vo <trong@android.com>
> >
> > Applied, thanks!
>
> Thank you!

Andrew,
this patch fixes 8c3d220cb6b5 ("gcov: clang support"). Could you
re-apply the gcov patch? Sorry, if it's a dumb question. I'm not
familiar with how cross-tree patches are handled in Linux.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2] module: add stubs for within_module functions
  2019-04-16 18:56           ` Tri Vo
@ 2019-04-16 21:38             ` Andrew Morton
  2019-04-17  8:59               ` Jessica Yu
  0 siblings, 1 reply; 10+ messages in thread
From: Andrew Morton @ 2019-04-16 21:38 UTC (permalink / raw)
  To: Tri Vo
  Cc: Nick Desaulniers, Greg Hackmann, linux-mm, kbuild-all,
	Randy Dunlap, kbuild test robot, LKML, Petri Gynther, willy,
	Peter Oberparleiter, Jessica Yu

On Tue, 16 Apr 2019 11:56:21 -0700 Tri Vo <trong@android.com> wrote:

> On Tue, Apr 16, 2019 at 10:55 AM Tri Vo <trong@android.com> wrote:
> >
> > On Tue, Apr 16, 2019 at 8:21 AM Jessica Yu <jeyu@kernel.org> wrote:
> > >
> > > +++ Tri Vo [15/04/19 11:18 -0700]:
> > > >Provide stubs for within_module_core(), within_module_init(), and
> > > >within_module() to prevent build errors when !CONFIG_MODULES.
> > > >
> > > >v2:
> > > >- Generalized commit message, as per Jessica.
> > > >- Stubs for within_module_core() and within_module_init(), as per Nick.
> > > >
> > > >Suggested-by: Matthew Wilcox <willy@infradead.org>
> > > >Reported-by: Randy Dunlap <rdunlap@infradead.org>
> > > >Reported-by: kbuild test robot <lkp@intel.com>
> > > >Link: https://marc.info/?l=linux-mm&m=155384681109231&w=2
> > > >Signed-off-by: Tri Vo <trong@android.com>
> > >
> > > Applied, thanks!
> >
> > Thank you!
> 
> Andrew,
> this patch fixes 8c3d220cb6b5 ("gcov: clang support"). Could you
> re-apply the gcov patch? Sorry, if it's a dumb question. I'm not
> familiar with how cross-tree patches are handled in Linux.

hm, I wonder what Jessica applied this patch to?

Please resend a new version of "gcov: clang support".

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2] module: add stubs for within_module functions
  2019-04-16 21:38             ` Andrew Morton
@ 2019-04-17  8:59               ` Jessica Yu
  0 siblings, 0 replies; 10+ messages in thread
From: Jessica Yu @ 2019-04-17  8:59 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Tri Vo, Nick Desaulniers, Greg Hackmann, linux-mm, kbuild-all,
	Randy Dunlap, kbuild test robot, LKML, Petri Gynther, willy,
	Peter Oberparleiter

+++ Andrew Morton [16/04/19 14:38 -0700]:
>On Tue, 16 Apr 2019 11:56:21 -0700 Tri Vo <trong@android.com> wrote:
>
>> On Tue, Apr 16, 2019 at 10:55 AM Tri Vo <trong@android.com> wrote:
>> >
>> > On Tue, Apr 16, 2019 at 8:21 AM Jessica Yu <jeyu@kernel.org> wrote:
>> > >
>> > > +++ Tri Vo [15/04/19 11:18 -0700]:
>> > > >Provide stubs for within_module_core(), within_module_init(), and
>> > > >within_module() to prevent build errors when !CONFIG_MODULES.
>> > > >
>> > > >v2:
>> > > >- Generalized commit message, as per Jessica.
>> > > >- Stubs for within_module_core() and within_module_init(), as per Nick.
>> > > >
>> > > >Suggested-by: Matthew Wilcox <willy@infradead.org>
>> > > >Reported-by: Randy Dunlap <rdunlap@infradead.org>
>> > > >Reported-by: kbuild test robot <lkp@intel.com>
>> > > >Link: https://marc.info/?l=linux-mm&m=155384681109231&w=2
>> > > >Signed-off-by: Tri Vo <trong@android.com>
>> > >
>> > > Applied, thanks!
>> >
>> > Thank you!
>>
>> Andrew,
>> this patch fixes 8c3d220cb6b5 ("gcov: clang support"). Could you
>> re-apply the gcov patch? Sorry, if it's a dumb question. I'm not
>> familiar with how cross-tree patches are handled in Linux.
>
>hm, I wonder what Jessica applied this patch to?

I applied the patch that supplies the missing within_module() stubs to
the modules-next branch (a link to the repo is available in
MAINTAINERS), it's landed in linux-next by now, and it should fix the
build error reported by the kbuild test bot.

Thanks,

Jessica


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-04-17  9:00 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-07  2:25 [PATCH] module: add stub for within_module Tri Vo
2019-04-08 18:08 ` Nick Desaulniers
2019-04-08 18:11   ` Nick Desaulniers
2019-04-15 14:22   ` Jessica Yu
2019-04-15 18:18     ` [PATCH v2] module: add stubs for within_module functions Tri Vo
2019-04-16 15:21       ` Jessica Yu
2019-04-16 17:55         ` Tri Vo
2019-04-16 18:56           ` Tri Vo
2019-04-16 21:38             ` Andrew Morton
2019-04-17  8:59               ` Jessica Yu

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