tree:
https://git.kernel.org/pub/scm/linux/kernel/git/luto/linux.git x86/membarrier
head: 07a8b963002cb955b7516e61bad19514a3acaa82
commit: f184d013a255a523116b692db4996c5db2569e86 [4/8] membarrier: Make the post-switch-mm
barrier explicit
config: ia64-randconfig-r015-20210615 (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.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/luto/linux.git/commit/?id...
git remote add luto
https://git.kernel.org/pub/scm/linux/kernel/git/luto/linux.git
git fetch --no-tags luto x86/membarrier
git checkout f184d013a255a523116b692db4996c5db2569e86
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
kernel/kthread.c: In function 'kthread_use_mm':
> kernel/kthread.c:1328:2: error: implicit declaration of function
'membarrier_finish_switch_mm' [-Werror=implicit-function-declaration]
1328 | membarrier_finish_switch_mm(atomic_read(&mm->membarrier_state));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from <command-line>:
> kernel/kthread.c:1328:45: error: 'struct mm_struct' has
no member named 'membarrier_state'
1328 |
membarrier_finish_switch_mm(atomic_read(&mm->membarrier_state));
| ^~
include/linux/compiler_types.h:308:9: note: in definition of macro
'__compiletime_assert'
308 | if (!(condition)) \
| ^~~~~~~~~
include/linux/compiler_types.h:328:2: note: in expansion of macro
'_compiletime_assert'
328 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:2: note: in expansion of macro
'compiletime_assert'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:21: note: in expansion of macro
'__native_word'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~
include/asm-generic/rwonce.h:49:2: note: in expansion of macro
'compiletime_assert_rwonce_type'
49 | compiletime_assert_rwonce_type(x); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/ia64/include/asm/atomic.h:24:25: note: in expansion of macro 'READ_ONCE'
24 | #define atomic_read(v) READ_ONCE((v)->counter)
| ^~~~~~~~~
kernel/kthread.c:1328:30: note: in expansion of macro 'atomic_read'
1328 | membarrier_finish_switch_mm(atomic_read(&mm->membarrier_state));
| ^~~~~~~~~~~
> kernel/kthread.c:1328:45: error: 'struct mm_struct' has
no member named 'membarrier_state'
1328 |
membarrier_finish_switch_mm(atomic_read(&mm->membarrier_state));
| ^~
include/linux/compiler_types.h:308:9: note: in definition of macro
'__compiletime_assert'
308 | if (!(condition)) \
| ^~~~~~~~~
include/linux/compiler_types.h:328:2: note: in expansion of macro
'_compiletime_assert'
328 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:2: note: in expansion of macro
'compiletime_assert'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:21: note: in expansion of macro
'__native_word'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~
include/asm-generic/rwonce.h:49:2: note: in expansion of macro
'compiletime_assert_rwonce_type'
49 | compiletime_assert_rwonce_type(x); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/ia64/include/asm/atomic.h:24:25: note: in expansion of macro 'READ_ONCE'
24 | #define atomic_read(v) READ_ONCE((v)->counter)
| ^~~~~~~~~
kernel/kthread.c:1328:30: note: in expansion of macro 'atomic_read'
1328 | membarrier_finish_switch_mm(atomic_read(&mm->membarrier_state));
| ^~~~~~~~~~~
> kernel/kthread.c:1328:45: error: 'struct mm_struct' has
no member named 'membarrier_state'
1328 |
membarrier_finish_switch_mm(atomic_read(&mm->membarrier_state));
| ^~
include/linux/compiler_types.h:308:9: note: in definition of macro
'__compiletime_assert'
308 | if (!(condition)) \
| ^~~~~~~~~
include/linux/compiler_types.h:328:2: note: in expansion of macro
'_compiletime_assert'
328 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:2: note: in expansion of macro
'compiletime_assert'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:21: note: in expansion of macro
'__native_word'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~
include/asm-generic/rwonce.h:49:2: note: in expansion of macro
'compiletime_assert_rwonce_type'
49 | compiletime_assert_rwonce_type(x); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/ia64/include/asm/atomic.h:24:25: note: in expansion of macro 'READ_ONCE'
24 | #define atomic_read(v) READ_ONCE((v)->counter)
| ^~~~~~~~~
kernel/kthread.c:1328:30: note: in expansion of macro 'atomic_read'
1328 | membarrier_finish_switch_mm(atomic_read(&mm->membarrier_state));
| ^~~~~~~~~~~
> kernel/kthread.c:1328:45: error: 'struct mm_struct' has
no member named 'membarrier_state'
1328 |
membarrier_finish_switch_mm(atomic_read(&mm->membarrier_state));
| ^~
include/linux/compiler_types.h:308:9: note: in definition of macro
'__compiletime_assert'
308 | if (!(condition)) \
| ^~~~~~~~~
include/linux/compiler_types.h:328:2: note: in expansion of macro
'_compiletime_assert'
328 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:2: note: in expansion of macro
'compiletime_assert'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:21: note: in expansion of macro
'__native_word'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~
include/asm-generic/rwonce.h:49:2: note: in expansion of macro
'compiletime_assert_rwonce_type'
49 | compiletime_assert_rwonce_type(x); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/ia64/include/asm/atomic.h:24:25: note: in expansion of macro 'READ_ONCE'
24 | #define atomic_read(v) READ_ONCE((v)->counter)
| ^~~~~~~~~
kernel/kthread.c:1328:30: note: in expansion of macro 'atomic_read'
1328 | membarrier_finish_switch_mm(atomic_read(&mm->membarrier_state));
| ^~~~~~~~~~~
> kernel/kthread.c:1328:45: error: 'struct mm_struct' has
no member named 'membarrier_state'
1328 |
membarrier_finish_switch_mm(atomic_read(&mm->membarrier_state));
| ^~
include/linux/compiler_types.h:308:9: note: in definition of macro
'__compiletime_assert'
308 | if (!(condition)) \
| ^~~~~~~~~
include/linux/compiler_types.h:328:2: note: in expansion of macro
'_compiletime_assert'
328 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:2: note: in expansion of macro
'compiletime_assert'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:49:2: note: in expansion of macro
'compiletime_assert_rwonce_type'
49 | compiletime_assert_rwonce_type(x); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/ia64/include/asm/atomic.h:24:25: note: in expansion of macro 'READ_ONCE'
24 | #define atomic_read(v) READ_ONCE((v)->counter)
| ^~~~~~~~~
kernel/kthread.c:1328:30: note: in expansion of macro 'atomic_read'
1328 | membarrier_finish_switch_mm(atomic_read(&mm->membarrier_state));
| ^~~~~~~~~~~
> kernel/kthread.c:1328:45: error: 'struct mm_struct' has
no member named 'membarrier_state'
1328 |
membarrier_finish_switch_mm(atomic_read(&mm->membarrier_state));
| ^~
include/linux/compiler_types.h:279:13: note: in definition of macro
'__unqual_scalar_typeof'
279 | _Generic((x), \
| ^
include/asm-generic/rwonce.h:50:2: note: in expansion of macro '__READ_ONCE'
50 | __READ_ONCE(x); \
| ^~~~~~~~~~~
arch/ia64/include/asm/atomic.h:24:25: note: in expansion of macro 'READ_ONCE'
24 | #define atomic_read(v) READ_ONCE((v)->counter)
| ^~~~~~~~~
kernel/kthread.c:1328:30: note: in expansion of macro 'atomic_read'
1328 | membarrier_finish_switch_mm(atomic_read(&mm->membarrier_state));
| ^~~~~~~~~~~
In file included from ./arch/ia64/include/generated/asm/rwonce.h:1,
from include/linux/compiler.h:248,
from include/asm-generic/bug.h:5,
from arch/ia64/include/asm/bug.h:17,
from include/linux/bug.h:5,
from include/linux/mmdebug.h:5,
from include/linux/mm.h:9,
from kernel/kthread.c:11:
> kernel/kthread.c:1328:45: error: 'struct mm_struct' has
no member named 'membarrier_state'
1328 |
membarrier_finish_switch_mm(atomic_read(&mm->membarrier_state));
| ^~
include/asm-generic/rwonce.h:44:72: note: in definition of macro '__READ_ONCE'
44 | #define __READ_ONCE(x) (*(const volatile __unqual_scalar_typeof(x) *)&(x))
| ^
arch/ia64/include/asm/atomic.h:24:25: note: in expansion of macro 'READ_ONCE'
24 | #define atomic_read(v) READ_ONCE((v)->counter)
| ^~~~~~~~~
kernel/kthread.c:1328:30: note: in expansion of macro 'atomic_read'
1328 | membarrier_finish_switch_mm(atomic_read(&mm->membarrier_state));
| ^~~~~~~~~~~
cc1: some warnings being treated as errors
--
kernel/sched/core.c:2850:6: warning: no previous prototype for
'sched_set_stop_task' [-Wmissing-prototypes]
2850 | void sched_set_stop_task(int cpu, struct task_struct *stop)
| ^~~~~~~~~~~~~~~~~~~
kernel/sched/core.c: In function 'context_switch':
> kernel/sched/core.c:4312:3: error: implicit declaration of
function 'membarrier_finish_switch_mm'; did you mean
'membarrier_switch_mm'? [-Werror=implicit-function-declaration]
4312 |
membarrier_finish_switch_mm(rq->membarrier_state);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
| membarrier_switch_mm
> kernel/sched/core.c:4312:33: error: 'struct rq' has no
member named 'membarrier_state'
4312 |
membarrier_finish_switch_mm(rq->membarrier_state);
| ^~
cc1: some warnings being treated as errors
vim +/membarrier_finish_switch_mm +1328 kernel/kthread.c
1304
1305 /**
1306 * kthread_use_mm - make the calling kthread operate on an address space
1307 * @mm: address space to operate on
1308 */
1309 void kthread_use_mm(struct mm_struct *mm)
1310 {
1311 struct mm_struct *active_mm;
1312 struct task_struct *tsk = current;
1313
1314 WARN_ON_ONCE(!(tsk->flags & PF_KTHREAD));
1315 WARN_ON_ONCE(tsk->mm);
1316
1317 task_lock(tsk);
1318 /* Hold off tlb flush IPIs while switching mm's */
1319 local_irq_disable();
1320 active_mm = tsk->active_mm;
1321 if (active_mm != mm) {
1322 mmgrab(mm);
1323 tsk->active_mm = mm;
1324 }
1325 tsk->mm = mm;
1326 membarrier_update_current_mm(mm);
1327 switch_mm_irqs_off(active_mm, mm, tsk);
1328 membarrier_finish_switch_mm(atomic_read(&mm->membarrier_state));
1329 local_irq_enable();
1330 task_unlock(tsk);
1331 #ifdef finish_arch_post_lock_switch
1332 finish_arch_post_lock_switch();
1333 #endif
1334
1335 if (active_mm != mm)
1336 mmdrop(active_mm);
1337
1338 to_kthread(tsk)->oldfs = force_uaccess_begin();
1339 }
1340 EXPORT_SYMBOL_GPL(kthread_use_mm);
1341
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org