[tip:WIP.sched/core 133/133] arch/sh/kernel/cpu/fpu.c:70:4: error: implicit declaration of function 'do_group_exit'

From: kbuild test robot
Date: Fri Feb 03 2017 - 10:32:03 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git WIP.sched/core
head: 9a631ea4bdc4d7a7faabc4a98d632f39573a9a8d
commit: 9a631ea4bdc4d7a7faabc4a98d632f39573a9a8d [133/133] sched/headers: Split <linux/sched/fork.h> out of <linux/sched.h>
config: sh-titan_defconfig (attached as .config)
compiler: sh4-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 9a631ea4bdc4d7a7faabc4a98d632f39573a9a8d
# save the attached .config to linux build tree
make.cross ARCH=sh

All errors (new ones prefixed by >>):

In file included from arch/sh/kernel/cpu/fpu.c:4:0:
arch/sh/include/asm/fpu.h: In function 'release_fpu':
arch/sh/include/asm/fpu.h:11:6: error: dereferencing pointer to incomplete type 'struct pt_regs'
regs->sr |= SR_FD;
^~
arch/sh/kernel/cpu/fpu.c: In function 'fpu_state_restore':
>> arch/sh/kernel/cpu/fpu.c:70:4: error: implicit declaration of function 'do_group_exit' [-Werror=implicit-function-declaration]
do_group_exit(SIGKILL);
^~~~~~~~~~~~~
cc1: some warnings being treated as errors

vim +/do_group_exit +70 arch/sh/kernel/cpu/fpu.c

4b93dd52 Ingo Molnar 2017-02-02 1 #include <linux/sched/signal.h>
5a0e3ad6 Tejun Heo 2010-03-24 2 #include <linux/slab.h>
0ea820cf Paul Mundt 2010-01-13 3 #include <asm/processor.h>
0ea820cf Paul Mundt 2010-01-13 @4 #include <asm/fpu.h>
f03c4866 Paul Mundt 2012-03-30 5 #include <asm/traps.h>
297dfd2a Ingo Molnar 2017-02-03 6 #include <asm/ptrace.h>
0ea820cf Paul Mundt 2010-01-13 7
0ea820cf Paul Mundt 2010-01-13 8 int init_fpu(struct task_struct *tsk)
0ea820cf Paul Mundt 2010-01-13 9 {
0ea820cf Paul Mundt 2010-01-13 10 if (tsk_used_math(tsk)) {
0ea820cf Paul Mundt 2010-01-13 11 if ((boot_cpu_data.flags & CPU_HAS_FPU) && tsk == current)
0ea820cf Paul Mundt 2010-01-13 12 unlazy_fpu(tsk, task_pt_regs(tsk));
0ea820cf Paul Mundt 2010-01-13 13 return 0;
0ea820cf Paul Mundt 2010-01-13 14 }
0ea820cf Paul Mundt 2010-01-13 15
0ea820cf Paul Mundt 2010-01-13 16 /*
0ea820cf Paul Mundt 2010-01-13 17 * Memory allocation at the first usage of the FPU and other state.
0ea820cf Paul Mundt 2010-01-13 18 */
0ea820cf Paul Mundt 2010-01-13 19 if (!tsk->thread.xstate) {
0ea820cf Paul Mundt 2010-01-13 20 tsk->thread.xstate = kmem_cache_alloc(task_xstate_cachep,
0ea820cf Paul Mundt 2010-01-13 21 GFP_KERNEL);
0ea820cf Paul Mundt 2010-01-13 22 if (!tsk->thread.xstate)
0ea820cf Paul Mundt 2010-01-13 23 return -ENOMEM;
0ea820cf Paul Mundt 2010-01-13 24 }
0ea820cf Paul Mundt 2010-01-13 25
0ea820cf Paul Mundt 2010-01-13 26 if (boot_cpu_data.flags & CPU_HAS_FPU) {
0ea820cf Paul Mundt 2010-01-13 27 struct sh_fpu_hard_struct *fp = &tsk->thread.xstate->hardfpu;
0ea820cf Paul Mundt 2010-01-13 28 memset(fp, 0, xstate_size);
0ea820cf Paul Mundt 2010-01-13 29 fp->fpscr = FPSCR_INIT;
0ea820cf Paul Mundt 2010-01-13 30 } else {
0ea820cf Paul Mundt 2010-01-13 31 struct sh_fpu_soft_struct *fp = &tsk->thread.xstate->softfpu;
0ea820cf Paul Mundt 2010-01-13 32 memset(fp, 0, xstate_size);
0ea820cf Paul Mundt 2010-01-13 33 fp->fpscr = FPSCR_INIT;
0ea820cf Paul Mundt 2010-01-13 34 }
0ea820cf Paul Mundt 2010-01-13 35
0ea820cf Paul Mundt 2010-01-13 36 set_stopped_child_used_math(tsk);
0ea820cf Paul Mundt 2010-01-13 37 return 0;
0ea820cf Paul Mundt 2010-01-13 38 }
0ea820cf Paul Mundt 2010-01-13 39
0ea820cf Paul Mundt 2010-01-13 40 #ifdef CONFIG_SH_FPU
0ea820cf Paul Mundt 2010-01-13 41 void __fpu_state_restore(void)
0ea820cf Paul Mundt 2010-01-13 42 {
0ea820cf Paul Mundt 2010-01-13 43 struct task_struct *tsk = current;
0ea820cf Paul Mundt 2010-01-13 44
0ea820cf Paul Mundt 2010-01-13 45 restore_fpu(tsk);
0ea820cf Paul Mundt 2010-01-13 46
0ea820cf Paul Mundt 2010-01-13 47 task_thread_info(tsk)->status |= TS_USEDFPU;
616c05d1 Vineet Gupta 2013-11-12 48 tsk->thread.fpu_counter++;
0ea820cf Paul Mundt 2010-01-13 49 }
0ea820cf Paul Mundt 2010-01-13 50
0ea820cf Paul Mundt 2010-01-13 51 void fpu_state_restore(struct pt_regs *regs)
0ea820cf Paul Mundt 2010-01-13 52 {
0ea820cf Paul Mundt 2010-01-13 53 struct task_struct *tsk = current;
0ea820cf Paul Mundt 2010-01-13 54
0ea820cf Paul Mundt 2010-01-13 55 if (unlikely(!user_mode(regs))) {
0ea820cf Paul Mundt 2010-01-13 56 printk(KERN_ERR "BUG: FPU is used in kernel mode.\n");
0ea820cf Paul Mundt 2010-01-13 57 BUG();
0ea820cf Paul Mundt 2010-01-13 58 return;
0ea820cf Paul Mundt 2010-01-13 59 }
0ea820cf Paul Mundt 2010-01-13 60
0ea820cf Paul Mundt 2010-01-13 61 if (!tsk_used_math(tsk)) {
4291b730 Paul Mundt 2010-01-18 62 local_irq_enable();
0ea820cf Paul Mundt 2010-01-13 63 /*
0ea820cf Paul Mundt 2010-01-13 64 * does a slab alloc which can sleep
0ea820cf Paul Mundt 2010-01-13 65 */
0ea820cf Paul Mundt 2010-01-13 66 if (init_fpu(tsk)) {
0ea820cf Paul Mundt 2010-01-13 67 /*
0ea820cf Paul Mundt 2010-01-13 68 * ran out of memory!
0ea820cf Paul Mundt 2010-01-13 69 */
0ea820cf Paul Mundt 2010-01-13 @70 do_group_exit(SIGKILL);
0ea820cf Paul Mundt 2010-01-13 71 return;
0ea820cf Paul Mundt 2010-01-13 72 }
4291b730 Paul Mundt 2010-01-18 73 local_irq_disable();

:::::: The code at line 70 was first introduced by commit
:::::: 0ea820cf9bf58f735ed40ec67947159c4f170012 sh: Move over to dynamically allocated FPU context.

:::::: TO: Paul Mundt <lethal@xxxxxxxxxxxx>
:::::: CC: Paul Mundt <lethal@xxxxxxxxxxxx>

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

Attachment: .config.gz
Description: application/gzip