tree:
https://git.kernel.org/pub/scm/linux/kernel/git/luto/linux.git x86/fixes
head: 087ddc16a1dd1d4cb567859f56eb0b28ef65ee6c
commit: 4def0489e2ed12c2280087e780bd67995b5cc537 [10/17] membarrier: Make the
post-switch-mm barrier explicit
config: x86_64-randconfig-a006-20210209 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
#
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/fixes
git checkout 4def0489e2ed12c2280087e780bd67995b5cc537
# save the attached .config to linux build tree
make W=1 ARCH=x86_64
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/sched/core.c:2835:6: warning: no previous prototype for
'sched_set_stop_task' [-Wmissing-prototypes]
2835 | void sched_set_stop_task(int cpu, struct task_struct *stop)
| ^~~~~~~~~~~~~~~~~~~
kernel/sched/core.c: In function 'schedule_tail':
kernel/sched/core.c:4240:13: warning: variable 'rq' set but not used
[-Wunused-but-set-variable]
4240 | struct rq *rq;
| ^~
kernel/sched/core.c: In function 'context_switch':
> kernel/sched/core.c:4300:3: error: implicit declaration of
function 'membarrier_finish_switch_mm'; did you mean
'membarrier_switch_mm'? [-Werror=implicit-function-declaration]
4300 |
membarrier_finish_switch_mm(rq->membarrier_state);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
| membarrier_switch_mm
kernel/sched/core.c:4300:33: error: 'struct rq' has no member named
'membarrier_state'
4300 | membarrier_finish_switch_mm(rq->membarrier_state);
| ^~
cc1: some warnings being treated as errors
vim +4300 kernel/sched/core.c
4259
4260 /*
4261 * context_switch - switch to the new MM and the new thread's register state.
4262 */
4263 static __always_inline struct rq *
4264 context_switch(struct rq *rq, struct task_struct *prev,
4265 struct task_struct *next, struct rq_flags *rf)
4266 {
4267 prepare_task_switch(rq, prev, next);
4268
4269 /*
4270 * For paravirt, this is coupled with an exit in switch_to to
4271 * combine the page table reload and the switch backend into
4272 * one hypercall.
4273 */
4274 arch_start_context_switch(prev);
4275
4276 /*
4277 * kernel -> kernel lazy + transfer active
4278 * user -> kernel lazy + mmgrab() active
4279 *
4280 * kernel -> user switch + mmdrop() active
4281 * user -> user switch
4282 */
4283 if (!next->mm) { // to kernel
4284 enter_lazy_tlb(prev->active_mm, next);
4285
4286 next->active_mm = prev->active_mm;
4287 if (prev->mm) // from user
4288 mmgrab(prev->active_mm);
4289 else
4290 prev->active_mm = NULL;
4291 } else { // to user
4292 membarrier_switch_mm(rq, prev->active_mm, next->mm);
4293 switch_mm_irqs_off(prev->active_mm, next->mm, next);
4294
4295 /*
4296 * sys_membarrier() requires an smp_mb() between setting
4297 * rq->curr->mm to a membarrier-enabled mm and returning
4298 * to userspace.
4299 */
4300 membarrier_finish_switch_mm(rq->membarrier_state);
4301
4302 if (!prev->mm) { // from kernel
4303 /* will mmdrop() in finish_task_switch(). */
4304 rq->prev_mm = prev->active_mm;
4305 prev->active_mm = NULL;
4306 }
4307 }
4308
4309 rq->clock_update_flags &= ~(RQCF_ACT_SKIP|RQCF_REQ_SKIP);
4310
4311 prepare_lock_switch(rq, next, rf);
4312
4313 /* Here we just switch the register state and the stack. */
4314 switch_to(prev, next, prev);
4315 barrier();
4316
4317 return finish_task_switch(prev);
4318 }
4319
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org