Re: [PATCH v2 3/3] RISC-V: Add support for srmcfg CSR from Ssqosid ext

kernel test robot
2025-09-16T15:56:44Z

Hi Drew,

kernel test robot noticed the following build errors:

[auto build test ERROR on 76eeb9b8de9880ca38696b2fb56ac45ac0a25c6c]

url: https://github.com/intel-lab-lkp/linux/commits/Drew-Fustini/dt-bindings-riscv-Add-Ssqosid-extension-description/20250916-131818
base: 76eeb9b8de9880ca38696b2fb56ac45ac0a25c6c
patch link: https://lore.kernel.org/r/20250915-ssqosid-v6-17-rc5-v2-3-2d4b0254dfd6%40kernel.org
patch subject: [PATCH v2 3/3] RISC-V: Add support for srmcfg CSR from Ssqosid ext
config: riscv-allnoconfig (https://download.01.org/0day-ci/archive/20250916/202509162355.wByessnb-lkp@intel.com/config)
compiler: riscv64-linux-gcc (GCC) 15.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250916/202509162355.wByessnb-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202509162355.wByessnb-lkp@intel.com/

All errors (new ones prefixed by >>):

kernel/sched/core.c: In function 'context_switch':
>> kernel/sched/core.c:5357:35: error: macro '__switch_to_srmcfg' passed 1 arguments, but takes just 0
5357 | switch_to(prev, next, prev);
| ^
In file included from arch/riscv/include/asm/switch_to.h:17,
from kernel/sched/core.c:80:
arch/riscv/include/asm/qos.h:38:9: note: macro '__switch_to_srmcfg' defined here
38 | #define __switch_to_srmcfg() do { } while (0)
| ^~~~~~~~~~~~~~~~~~
>> arch/riscv/include/asm/switch_to.h:124:17: error: '__switch_to_srmcfg' undeclared (first use in this function); did you mean '__switch_to_envcfg'?
124 | __switch_to_srmcfg(__next); \
| ^~~~~~~~~~~~~~~~~~
kernel/sched/core.c:5357:9: note: in expansion of macro 'switch_to'
5357 | switch_to(prev, next, prev);
| ^~~~~~~~~
arch/riscv/include/asm/switch_to.h:124:17: note: each undeclared identifier is reported only once for each function it appears in
124 | __switch_to_srmcfg(__next); \
| ^~~~~~~~~~~~~~~~~~
kernel/sched/core.c:5357:9: note: in expansion of macro 'switch_to'
5357 | switch_to(prev, next, prev);
| ^~~~~~~~~

vim +/__switch_to_srmcfg +5357 kernel/sched/core.c

^1da177e4c3f41 kernel/sched.c Linus Torvalds 2005-04-16 5296
^1da177e4c3f41 kernel/sched.c Linus Torvalds 2005-04-16 5297 /*
dfa50b605c2a93 kernel/sched/core.c Oleg Nesterov 2014-10-09 5298 * context_switch - switch to the new MM and the new thread's register state.
^1da177e4c3f41 kernel/sched.c Linus Torvalds 2005-04-16 5299 */
049369487e2068 kernel/sched/core.c Josh Poimboeuf 2016-02-28 5300 static __always_inline struct rq *
70b97a7f0b19cf kernel/sched.c Ingo Molnar 2006-07-03 5301 context_switch(struct rq *rq, struct task_struct *prev,
d8ac897137a230 kernel/sched/core.c Matt Fleming 2016-09-21 5302 struct task_struct *next, struct rq_flags *rf)
^1da177e4c3f41 kernel/sched.c Linus Torvalds 2005-04-16 5303 {
e107be36efb2a2 kernel/sched.c Avi Kivity 2007-07-26 5304 prepare_task_switch(rq, prev, next);
fe4b04fa31a6dc kernel/sched.c Peter Zijlstra 2011-02-02 5305
9226d125d94c7e kernel/sched.c Zachary Amsden 2007-02-13 5306 /*
9226d125d94c7e kernel/sched.c Zachary Amsden 2007-02-13 5307 * For paravirt, this is coupled with an exit in switch_to to
9226d125d94c7e kernel/sched.c Zachary Amsden 2007-02-13 5308 * combine the page table reload and the switch backend into
9226d125d94c7e kernel/sched.c Zachary Amsden 2007-02-13 5309 * one hypercall.
9226d125d94c7e kernel/sched.c Zachary Amsden 2007-02-13 5310 */
224101ed69d3fb kernel/sched.c Jeremy Fitzhardinge 2009-02-18 5311 arch_start_context_switch(prev);
9226d125d94c7e kernel/sched.c Zachary Amsden 2007-02-13 5312
306e060435d7a3 kernel/sched/core.c Mathieu Desnoyers 2018-01-29 5313 /*
139d025cda1da5 kernel/sched/core.c Peter Zijlstra 2019-07-29 5314 * kernel -> kernel lazy + transfer active
aa464ba9a1e444 kernel/sched/core.c Nicholas Piggin 2023-02-03 5315 * user -> kernel lazy + mmgrab_lazy_tlb() active
139d025cda1da5 kernel/sched/core.c Peter Zijlstra 2019-07-29 5316 *
aa464ba9a1e444 kernel/sched/core.c Nicholas Piggin 2023-02-03 5317 * kernel -> user switch + mmdrop_lazy_tlb() active
139d025cda1da5 kernel/sched/core.c Peter Zijlstra 2019-07-29 5318 * user -> user switch
223baf9d17f25e kernel/sched/core.c Mathieu Desnoyers 2023-04-20 5319 *
223baf9d17f25e kernel/sched/core.c Mathieu Desnoyers 2023-04-20 5320 * switch_mm_cid() needs to be updated if the barriers provided
223baf9d17f25e kernel/sched/core.c Mathieu Desnoyers 2023-04-20 5321 * by context_switch() are modified.
306e060435d7a3 kernel/sched/core.c Mathieu Desnoyers 2018-01-29 5322 */
139d025cda1da5 kernel/sched/core.c Peter Zijlstra 2019-07-29 5323 if (!next->mm) { // to kernel
139d025cda1da5 kernel/sched/core.c Peter Zijlstra 2019-07-29 5324 enter_lazy_tlb(prev->active_mm, next);
^1da177e4c3f41 kernel/sched.c Linus Torvalds 2005-04-16 5325
139d025cda1da5 kernel/sched/core.c Peter Zijlstra 2019-07-29 5326 next->active_mm = prev->active_mm;
139d025cda1da5 kernel/sched/core.c Peter Zijlstra 2019-07-29 5327 if (prev->mm) // from user
aa464ba9a1e444 kernel/sched/core.c Nicholas Piggin 2023-02-03 5328 mmgrab_lazy_tlb(prev->active_mm);
139d025cda1da5 kernel/sched/core.c Peter Zijlstra 2019-07-29 5329 else
139d025cda1da5 kernel/sched/core.c Peter Zijlstra 2019-07-29 5330 prev->active_mm = NULL;
139d025cda1da5 kernel/sched/core.c Peter Zijlstra 2019-07-29 5331 } else { // to user
227a4aadc75ba2 kernel/sched/core.c Mathieu Desnoyers 2019-09-19 5332 membarrier_switch_mm(rq, prev->active_mm, next->mm);
139d025cda1da5 kernel/sched/core.c Peter Zijlstra 2019-07-29 5333 /*
139d025cda1da5 kernel/sched/core.c Peter Zijlstra 2019-07-29 5334 * sys_membarrier() requires an smp_mb() between setting
227a4aadc75ba2 kernel/sched/core.c Mathieu Desnoyers 2019-09-19 5335 * rq->curr / membarrier_switch_mm() and returning to userspace.
139d025cda1da5 kernel/sched/core.c Peter Zijlstra 2019-07-29 5336 *
139d025cda1da5 kernel/sched/core.c Peter Zijlstra 2019-07-29 5337 * The below provides this either through switch_mm(), or in
139d025cda1da5 kernel/sched/core.c Peter Zijlstra 2019-07-29 5338 * case 'prev->active_mm == next->mm' through
139d025cda1da5 kernel/sched/core.c Peter Zijlstra 2019-07-29 5339 * finish_task_switch()'s mmdrop().
306e060435d7a3 kernel/sched/core.c Mathieu Desnoyers 2018-01-29 5340 */
139d025cda1da5 kernel/sched/core.c Peter Zijlstra 2019-07-29 5341 switch_mm_irqs_off(prev->active_mm, next->mm, next);
bd74fdaea14602 kernel/sched/core.c Yu Zhao 2022-09-18 5342 lru_gen_use_mm(next->mm);
139d025cda1da5 kernel/sched/core.c Peter Zijlstra 2019-07-29 5343
139d025cda1da5 kernel/sched/core.c Peter Zijlstra 2019-07-29 5344 if (!prev->mm) { // from kernel
aa464ba9a1e444 kernel/sched/core.c Nicholas Piggin 2023-02-03 5345 /* will mmdrop_lazy_tlb() in finish_task_switch(). */
139d025cda1da5 kernel/sched/core.c Peter Zijlstra 2019-07-29 5346 rq->prev_mm = prev->active_mm;
^1da177e4c3f41 kernel/sched.c Linus Torvalds 2005-04-16 5347 prev->active_mm = NULL;
139d025cda1da5 kernel/sched/core.c Peter Zijlstra 2019-07-29 5348 }
^1da177e4c3f41 kernel/sched.c Linus Torvalds 2005-04-16 5349 }
92509b732baf14 kernel/sched/core.c Matt Fleming 2016-09-21 5350
223baf9d17f25e kernel/sched/core.c Mathieu Desnoyers 2023-04-20 5351 /* switch_mm_cid() requires the memory barriers above. */
223baf9d17f25e kernel/sched/core.c Mathieu Desnoyers 2023-04-20 5352 switch_mm_cid(rq, prev, next);
223baf9d17f25e kernel/sched/core.c Mathieu Desnoyers 2023-04-20 5353
269d599271fa60 kernel/sched/core.c Peter Zijlstra 2018-02-06 5354 prepare_lock_switch(rq, next, rf);
^1da177e4c3f41 kernel/sched.c Linus Torvalds 2005-04-16 5355
^1da177e4c3f41 kernel/sched.c Linus Torvalds 2005-04-16 5356 /* Here we just switch the register state and the stack. */
^1da177e4c3f41 kernel/sched.c Linus Torvalds 2005-04-16 @5357 switch_to(prev, next, prev);
dd41f596cda0d7 kernel/sched.c Ingo Molnar 2007-07-09 5358 barrier();
dfa50b605c2a93 kernel/sched/core.c Oleg Nesterov 2014-10-09 5359
dfa50b605c2a93 kernel/sched/core.c Oleg Nesterov 2014-10-09 5360 return finish_task_switch(prev);
^1da177e4c3f41 kernel/sched.c Linus Torvalds 2005-04-16 5361 }
f711f6090a81cb kernel/sched.c Gautham R Shenoy 2009-04-14 5362

--
0-DAY CI Kernel Test Service