[mingo-tip:sched/headers 563/2574] include/linux/thread_info.h:26:32: error: implicit declaration of function 'task_thread_info'

From: kernel test robot
Date: Sun Feb 20 2022 - 19:40:16 EST


tree: git://git.kernel.org/pub/scm/linux/kernel/git/mingo/tip.git sched/headers
head: 39e8a0edc8fae20758051dadf7846849edc18b88
commit: 4f6c6b91b52731738bf7ad7781424f7081f05e62 [563/2574] headers/deps: Move task->thread_info to per_task()
config: s390-randconfig-r016-20220220 (https://download.01.org/0day-ci/archive/20220221/202202210837.WwxLXNe0-lkp@xxxxxxxxx/config)
compiler: s390-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/mingo/tip.git/commit/?id=4f6c6b91b52731738bf7ad7781424f7081f05e62
git remote add mingo-tip git://git.kernel.org/pub/scm/linux/kernel/git/mingo/tip.git
git fetch --no-tags mingo-tip sched/headers
git checkout 4f6c6b91b52731738bf7ad7781424f7081f05e62
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=s390 prepare

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All error/warnings (new ones prefixed by >>):

In file included from arch/s390/include/asm/preempt.h:6,
from include/linux/preempt.h:78,
from include/linux/smp.h:110,
from include/linux/percpu.h:6,
from include/linux/context_tracking_state.h:5,
from include/linux/hardirq.h:5,
from include/linux/kvm_host.h:7,
from arch/s390/kernel/asm-offsets.c:11:
arch/s390/include/asm/preempt.h: In function '__preempt_count_dec_and_test':
>> include/linux/thread_info.h:26:32: error: implicit declaration of function 'task_thread_info' [-Werror=implicit-function-declaration]
26 | # define current_thread_info() task_thread_info(current)
| ^~~~~~~~~~~~~~~~
include/linux/sched/thread_info_api_lowlevel.h:64:29: note: in expansion of macro 'current_thread_info'
64 | test_ti_thread_flag(current_thread_info(), flag)
| ^~~~~~~~~~~~~~~~~~~
include/linux/sched/thread_info_api_lowlevel.h:103:28: note: in expansion of macro 'test_thread_flag'
103 | #define tif_need_resched() test_thread_flag(TIF_NEED_RESCHED)
| ^~~~~~~~~~~~~~~~
arch/s390/include/asm/preempt.h:110:49: note: in expansion of macro 'tif_need_resched'
110 | return !--S390_lowcore.preempt_count && tif_need_resched();
| ^~~~~~~~~~~~~~~~
>> include/linux/thread_info.h:26:32: warning: passing argument 1 of 'test_ti_thread_flag' makes pointer from integer without a cast [-Wint-conversion]
26 | # define current_thread_info() task_thread_info(current)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
| |
| int
include/linux/sched/thread_info_api_lowlevel.h:64:29: note: in expansion of macro 'current_thread_info'
64 | test_ti_thread_flag(current_thread_info(), flag)
| ^~~~~~~~~~~~~~~~~~~
include/linux/sched/thread_info_api_lowlevel.h:103:28: note: in expansion of macro 'test_thread_flag'
103 | #define tif_need_resched() test_thread_flag(TIF_NEED_RESCHED)
| ^~~~~~~~~~~~~~~~
arch/s390/include/asm/preempt.h:110:49: note: in expansion of macro 'tif_need_resched'
110 | return !--S390_lowcore.preempt_count && tif_need_resched();
| ^~~~~~~~~~~~~~~~
In file included from include/linux/thread_info.h:63,
from arch/s390/include/asm/preempt.h:6,
from include/linux/preempt.h:78,
from include/linux/smp.h:110,
from include/linux/percpu.h:6,
from include/linux/context_tracking_state.h:5,
from include/linux/hardirq.h:5,
from include/linux/kvm_host.h:7,
from arch/s390/kernel/asm-offsets.c:11:
include/linux/sched/thread_info_api_lowlevel.h:39:59: note: expected 'struct thread_info *' but argument is of type 'int'
39 | static inline int test_ti_thread_flag(struct thread_info *ti, int flag)
| ~~~~~~~~~~~~~~~~~~~~^~
In file included from include/linux/build_bug.h:5,
from include/linux/container_of.h:5,
from include/linux/list.h:5,
from include/linux/smp.h:12,
from include/linux/percpu.h:6,
from include/linux/context_tracking_state.h:5,
from include/linux/hardirq.h:5,
from include/linux/kvm_host.h:7,
from arch/s390/kernel/asm-offsets.c:11:
arch/s390/include/asm/preempt.h: In function 'should_resched':
>> include/linux/thread_info.h:26:32: warning: passing argument 1 of 'test_ti_thread_flag' makes pointer from integer without a cast [-Wint-conversion]
26 | # define current_thread_info() task_thread_info(current)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
| |
| int
include/linux/compiler.h:78:45: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
include/linux/sched/thread_info_api_lowlevel.h:64:29: note: in expansion of macro 'current_thread_info'
64 | test_ti_thread_flag(current_thread_info(), flag)
| ^~~~~~~~~~~~~~~~~~~
include/linux/sched/thread_info_api_lowlevel.h:103:28: note: in expansion of macro 'test_thread_flag'
103 | #define tif_need_resched() test_thread_flag(TIF_NEED_RESCHED)
| ^~~~~~~~~~~~~~~~
arch/s390/include/asm/preempt.h:116:25: note: in expansion of macro 'tif_need_resched'
116 | tif_need_resched());
| ^~~~~~~~~~~~~~~~
In file included from include/linux/thread_info.h:63,
from arch/s390/include/asm/preempt.h:6,
from include/linux/preempt.h:78,
from include/linux/smp.h:110,
from include/linux/percpu.h:6,
from include/linux/context_tracking_state.h:5,
from include/linux/hardirq.h:5,
from include/linux/kvm_host.h:7,
from arch/s390/kernel/asm-offsets.c:11:
include/linux/sched/thread_info_api_lowlevel.h:39:59: note: expected 'struct thread_info *' but argument is of type 'int'
39 | static inline int test_ti_thread_flag(struct thread_info *ti, int flag)
| ~~~~~~~~~~~~~~~~~~~~^~
In file included from include/linux/sched.h:12,
from include/linux/hardirq.h:9,
from include/linux/kvm_host.h:7,
from arch/s390/kernel/asm-offsets.c:11:
include/linux/sched/per_task.h: At top level:
include/linux/sched/per_task.h:48:11: fatal error: generated/asm-offsets.h: No such file or directory
48 | # include <generated/asm-offsets.h>
| ^~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
compilation terminated.
make[2]: *** [scripts/Makefile.build:121: arch/s390/kernel/asm-offsets.s] Error 1
make[2]: Target '__build' not remade because of errors.
make[1]: *** [Makefile:1191: prepare0] Error 2
make[1]: Target 'prepare' not remade because of errors.
make: *** [Makefile:219: __sub-make] Error 2
make: Target 'prepare' not remade because of errors.


vim +/task_thread_info +26 include/linux/thread_info.h

16
17 #ifdef CONFIG_THREAD_INFO_IN_TASK
18 /* We are racing with <linux/sched/thread_info.h> to do this: */
19 # ifndef current_thread_info
20 /*
21 * For CONFIG_THREAD_INFO_IN_TASK kernels we need <asm/current.h> for the
22 * definition of current, but for !CONFIG_THREAD_INFO_IN_TASK kernels,
23 * including <asm/current.h> can cause a circular dependency on some platforms.
24 */
25 # include <asm/current.h>
> 26 # define current_thread_info() task_thread_info(current)
27 # endif
28 #endif
29

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx