linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [linux-next:master 6470/6646] include/linux/kprobes.h:477:9: error: implicit declaration of function 'kprobe_fault_handler'; did you mean 'kprobe_page_fault'?
@ 2019-06-15  2:55 kbuild test robot
  2019-06-18  2:07 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: kbuild test robot @ 2019-06-15  2:55 UTC (permalink / raw)
  To: Anshuman Khandual
  Cc: kbuild-all, Dave Hansen, Andrew Morton, Linux Memory Management List

[-- Attachment #1: Type: text/plain, Size: 4472 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   f4788d37bc84e27ac9370be252afb451bf6ef718
commit: 4dd635bce90e8b6ed31c08cd654deca29f4d9d66 [6470/6646] mm, kprobes: generalize and rename notify_page_fault() as kprobe_page_fault()
config: mips-allmodconfig (attached as .config)
compiler: mips-linux-gcc (GCC) 7.4.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout 4dd635bce90e8b6ed31c08cd654deca29f4d9d66
        # save the attached .config to linux build tree
        GCC_VERSION=7.4.0 make.cross ARCH=mips 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   In file included from net//sctp/offload.c:11:0:
   include/linux/kprobes.h: In function 'kprobe_page_fault':
>> include/linux/kprobes.h:477:9: error: implicit declaration of function 'kprobe_fault_handler'; did you mean 'kprobe_page_fault'? [-Werror=implicit-function-declaration]
     return kprobe_fault_handler(regs, trap);
            ^~~~~~~~~~~~~~~~~~~~
            kprobe_page_fault
   cc1: some warnings being treated as errors
--
   In file included from arch/mips//kernel/traps.c:36:0:
   include/linux/kprobes.h: In function 'kprobe_page_fault':
>> include/linux/kprobes.h:477:9: error: implicit declaration of function 'kprobe_fault_handler'; did you mean 'kprobe_page_fault'? [-Werror=implicit-function-declaration]
     return kprobe_fault_handler(regs, trap);
            ^~~~~~~~~~~~~~~~~~~~
            kprobe_page_fault
   cc1: all warnings being treated as errors
--
   In file included from arch/mips//kernel/kprobes.c:14:0:
   include/linux/kprobes.h: In function 'kprobe_page_fault':
>> include/linux/kprobes.h:477:9: error: implicit declaration of function 'kprobe_fault_handler'; did you mean 'kprobe_page_fault'? [-Werror=implicit-function-declaration]
     return kprobe_fault_handler(regs, trap);
            ^~~~~~~~~~~~~~~~~~~~
            kprobe_page_fault
   arch/mips//kernel/kprobes.c: At top level:
>> arch/mips//kernel/kprobes.c:401:19: error: static declaration of 'kprobe_fault_handler' follows non-static declaration
    static inline int kprobe_fault_handler(struct pt_regs *regs, int trapnr)
                      ^~~~~~~~~~~~~~~~~~~~
   In file included from arch/mips//kernel/kprobes.c:14:0:
   include/linux/kprobes.h:477:9: note: previous implicit declaration of 'kprobe_fault_handler' was here
     return kprobe_fault_handler(regs, trap);
            ^~~~~~~~~~~~~~~~~~~~
   cc1: all warnings being treated as errors
--
   In file included from arch/mips/kernel/kprobes.c:14:0:
   include/linux/kprobes.h: In function 'kprobe_page_fault':
>> include/linux/kprobes.h:477:9: error: implicit declaration of function 'kprobe_fault_handler'; did you mean 'kprobe_page_fault'? [-Werror=implicit-function-declaration]
     return kprobe_fault_handler(regs, trap);
            ^~~~~~~~~~~~~~~~~~~~
            kprobe_page_fault
   arch/mips/kernel/kprobes.c: At top level:
   arch/mips/kernel/kprobes.c:401:19: error: static declaration of 'kprobe_fault_handler' follows non-static declaration
    static inline int kprobe_fault_handler(struct pt_regs *regs, int trapnr)
                      ^~~~~~~~~~~~~~~~~~~~
   In file included from arch/mips/kernel/kprobes.c:14:0:
   include/linux/kprobes.h:477:9: note: previous implicit declaration of 'kprobe_fault_handler' was here
     return kprobe_fault_handler(regs, trap);
            ^~~~~~~~~~~~~~~~~~~~
   cc1: all warnings being treated as errors

vim +477 include/linux/kprobes.h

   460	
   461	/* Returns true if kprobes handled the fault */
   462	static nokprobe_inline bool kprobe_page_fault(struct pt_regs *regs,
   463						      unsigned int trap)
   464	{
   465		if (!kprobes_built_in())
   466			return false;
   467		if (user_mode(regs))
   468			return false;
   469		/*
   470		 * To be potentially processing a kprobe fault and to be allowed
   471		 * to call kprobe_running(), we have to be non-preemptible.
   472		 */
   473		if (preemptible())
   474			return false;
   475		if (!kprobe_running())
   476			return false;
 > 477		return kprobe_fault_handler(regs, trap);
   478	}
   479	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 60701 bytes --]

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

* Re: [linux-next:master 6470/6646] include/linux/kprobes.h:477:9: error: implicit declaration of function 'kprobe_fault_handler'; did you mean 'kprobe_page_fault'?
  2019-06-15  2:55 [linux-next:master 6470/6646] include/linux/kprobes.h:477:9: error: implicit declaration of function 'kprobe_fault_handler'; did you mean 'kprobe_page_fault'? kbuild test robot
@ 2019-06-18  2:07 ` Andrew Morton
  2019-06-20  9:00   ` Anshuman Khandual
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2019-06-18  2:07 UTC (permalink / raw)
  To: kbuild test robot
  Cc: Anshuman Khandual, kbuild-all, Dave Hansen, Linux Memory Management List

On Sat, 15 Jun 2019 10:55:07 +0800 kbuild test robot <lkp@intel.com> wrote:

> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head:   f4788d37bc84e27ac9370be252afb451bf6ef718
> commit: 4dd635bce90e8b6ed31c08cd654deca29f4d9d66 [6470/6646] mm, kprobes: generalize and rename notify_page_fault() as kprobe_page_fault()
> config: mips-allmodconfig (attached as .config)
> compiler: mips-linux-gcc (GCC) 7.4.0
> reproduce:
>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         git checkout 4dd635bce90e8b6ed31c08cd654deca29f4d9d66
>         # save the attached .config to linux build tree
>         GCC_VERSION=7.4.0 make.cross ARCH=mips 
> 
> If you fix the issue, kindly add following tag
> Reported-by: kbuild test robot <lkp@intel.com>
> 
> All errors (new ones prefixed by >>):
> 
>    In file included from net//sctp/offload.c:11:0:
>    include/linux/kprobes.h: In function 'kprobe_page_fault':
> >> include/linux/kprobes.h:477:9: error: implicit declaration of function 'kprobe_fault_handler'; did you mean 'kprobe_page_fault'? [-Werror=implicit-function-declaration]
>      return kprobe_fault_handler(regs, trap);

Urgh, OK, thanks.

kprobe_fault_handler() is only ever defined and referenced in arch code
and generic code has no right to be assuming that the architecture
actually provides it.  And so it is with mips (at least).

The !CONFIG_KPROBES stub version of kprobe_fault_handler() should not
have been placed in include/linux/kprobes.h!  Each arch should have
defined its own, if that proved necessary.

Oh well, ho hum.  Hopefully Anshuman will be able to come up with a fix
for mips and any similarly-affected architectures.

Also, please very carefully check that this patchset is correct for all
architectures!  kprobe_fault_handler() could conceivably do different
things on different architectures.


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

* Re: [linux-next:master 6470/6646] include/linux/kprobes.h:477:9: error: implicit declaration of function 'kprobe_fault_handler'; did you mean 'kprobe_page_fault'?
  2019-06-18  2:07 ` Andrew Morton
@ 2019-06-20  9:00   ` Anshuman Khandual
  0 siblings, 0 replies; 3+ messages in thread
From: Anshuman Khandual @ 2019-06-20  9:00 UTC (permalink / raw)
  To: Andrew Morton, kbuild test robot
  Cc: kbuild-all, Dave Hansen, Linux Memory Management List

Hello Andrew,

On 06/18/2019 07:37 AM, Andrew Morton wrote:
> On Sat, 15 Jun 2019 10:55:07 +0800 kbuild test robot <lkp@intel.com> wrote:
> 
>> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
>> head:   f4788d37bc84e27ac9370be252afb451bf6ef718
>> commit: 4dd635bce90e8b6ed31c08cd654deca29f4d9d66 [6470/6646] mm, kprobes: generalize and rename notify_page_fault() as kprobe_page_fault()
>> config: mips-allmodconfig (attached as .config)
>> compiler: mips-linux-gcc (GCC) 7.4.0
>> reproduce:
>>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>>         chmod +x ~/bin/make.cross
>>         git checkout 4dd635bce90e8b6ed31c08cd654deca29f4d9d66
>>         # save the attached .config to linux build tree
>>         GCC_VERSION=7.4.0 make.cross ARCH=mips 
>>
>> If you fix the issue, kindly add following tag
>> Reported-by: kbuild test robot <lkp@intel.com>
>>
>> All errors (new ones prefixed by >>):
>>
>>    In file included from net//sctp/offload.c:11:0:
>>    include/linux/kprobes.h: In function 'kprobe_page_fault':
>>>> include/linux/kprobes.h:477:9: error: implicit declaration of function 'kprobe_fault_handler'; did you mean 'kprobe_page_fault'? [-Werror=implicit-function-declaration]
>>      return kprobe_fault_handler(regs, trap);
> 
> Urgh, OK, thanks.
> 
> kprobe_fault_handler() is only ever defined and referenced in arch code
> and generic code has no right to be assuming that the architecture
> actually provides it.  And so it is with mips (at least).

Hmm, so the problem really is that on mips arch even though CONFIG_KPROBES
is enabled, it does not export (though it defines) a kprobe_fault_handler()
implementation unlike all other architectures.

Now that generic code calls kprobe_fault_handler(), should not all arch be
providing one when they subscribe to CONFIG_KPROBES ? In which case mips
should just export it's existing definition to fix this build problem.

> 
> The !CONFIG_KPROBES stub version of kprobe_fault_handler() should not
> have been placed in include/linux/kprobes.h!  Each arch should have
> defined its own, if that proved necessary.

I guess its there in include/linux/kprobes.h! because !CONFIG_KPROBES stub
version for all archs will exactly look the same.

> 
> Oh well, ho hum.  Hopefully Anshuman will be able to come up with a fix
> for mips and any similarly-affected architectures.

Will export it's existing definition via arch/mips/include/asm/kprobes.h
unless that is problematic for other reasons. Another solution would be
to define an weak symbol in include/linux/kprobes.h for CONFIG_KPROBES.
But that will not be correct because kprobe_fault_handler() by all means
is always platform specific.

> 
> Also, please very carefully check that this patchset is correct for all
> architectures!  kprobe_fault_handler() could conceivably do different
> things on different architectures.

Agreed.


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

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

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-15  2:55 [linux-next:master 6470/6646] include/linux/kprobes.h:477:9: error: implicit declaration of function 'kprobe_fault_handler'; did you mean 'kprobe_page_fault'? kbuild test robot
2019-06-18  2:07 ` Andrew Morton
2019-06-20  9:00   ` Anshuman Khandual

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