Skip to contentSkip to conversation

arch/loongarch/kernel/switch.S:28:18: error: operand must be a symbol with modifier (e.g. %pc_lo12) or an integer in the range

PATCH kernel test robot 2 participants 2 messages Nov 23, 2025 – Nov 24, 2025 LoongArch

lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   d724c6f85e80a23ed46b7ebc6e38b527c09d64f5
commit: f634f10809ec3d51d9529dfb0f99bc7cec1b5eff [2198/11041] mm/mempolicy: Export memory policy symbols
config: loongarch-randconfig-r051-20251123 (https://download.01.org/0day-ci/archive/20251124/[email protected]/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251124/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

>> arch/loongarch/kernel/switch.S:28:18: error: operand must be a symbol with modifier (e.g. %pc_lo12) or an integer in the range [-2048, 2047]
    ld.d $r20, $r5, 3808
                    ^

vim +28 arch/loongarch/kernel/switch.S

803b0fc5c3f2ba Huacai Chen 2022-05-31  12  
803b0fc5c3f2ba Huacai Chen 2022-05-31  13  /*
803b0fc5c3f2ba Huacai Chen 2022-05-31  14   * task_struct *__switch_to(task_struct *prev, task_struct *next,
613d4164f5a503 Huacai Chen 2025-01-25  15   *			    struct thread_info *next_ti, void *sched_ra, void *sched_cfa)
803b0fc5c3f2ba Huacai Chen 2022-05-31  16   */
803b0fc5c3f2ba Huacai Chen 2022-05-31  17  	.align	5
803b0fc5c3f2ba Huacai Chen 2022-05-31  18  SYM_FUNC_START(__switch_to)
803b0fc5c3f2ba Huacai Chen 2022-05-31  19  	csrrd	t1, LOONGARCH_CSR_PRMD
803b0fc5c3f2ba Huacai Chen 2022-05-31  20  	stptr.d	t1, a0, THREAD_CSRPRMD
803b0fc5c3f2ba Huacai Chen 2022-05-31  21  
803b0fc5c3f2ba Huacai Chen 2022-05-31  22  	cpu_save_nonscratch a0
803b0fc5c3f2ba Huacai Chen 2022-05-31  23  	stptr.d	ra, a0, THREAD_REG01
93a4fa622eb061 Qing Zhang  2022-08-06  24  	stptr.d a3, a0, THREAD_SCHED_RA
93a4fa622eb061 Qing Zhang  2022-08-06  25  	stptr.d a4, a0, THREAD_SCHED_CFA
09f33601bf940f Huacai Chen 2022-12-10  26  #if defined(CONFIG_STACKPROTECTOR) && !defined(CONFIG_SMP)
09f33601bf940f Huacai Chen 2022-12-10  27  	la	t7, __stack_chk_guard

09f33601bf940f Huacai Chen 2022-12-10 @28 LONG_L t8, a1, TASK_STACK_CANARY

:::::: The code at line 28 was first introduced by commit
:::::: 09f33601bf940f955c10a6e75a1c1b7bcadee5e2 LoongArch: Add basic STACKPROTECTOR support

:::::: TO: Huacai Chen <[email protected]>
:::::: CC: Huacai Chen <[email protected]>

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#1 lore raw
Quoted 37 lines · kernel test robot
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   d724c6f85e80a23ed46b7ebc6e38b527c09d64f5
commit: f634f10809ec3d51d9529dfb0f99bc7cec1b5eff [2198/11041] mm/mempolicy: Export memory policy symbols
config: loongarch-randconfig-r051-20251123 (https://download.01.org/0day-ci/archive/20251124/[email protected]/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251124/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

Quoted 1 line
Quoted 1 line

arch/loongarch/kernel/switch.S:28:18: error: operand must be a symbol with modifier (e.g. %pc_lo12) or an integer in the range [-2048, 2047]

    ld.d $r20, $r5, 3808
                    ^

vim +28 arch/loongarch/kernel/switch.S

803b0fc5c3f2ba Huacai Chen 2022-05-31  12  
803b0fc5c3f2ba Huacai Chen 2022-05-31  13  /*
803b0fc5c3f2ba Huacai Chen 2022-05-31  14   * task_struct *__switch_to(task_struct *prev, task_struct *next,
613d4164f5a503 Huacai Chen 2025-01-25  15   *			    struct thread_info *next_ti, void *sched_ra, void *sched_cfa)
803b0fc5c3f2ba Huacai Chen 2022-05-31  16   */
803b0fc5c3f2ba Huacai Chen 2022-05-31  17  	.align	5
803b0fc5c3f2ba Huacai Chen 2022-05-31  18  SYM_FUNC_START(__switch_to)
803b0fc5c3f2ba Huacai Chen 2022-05-31  19  	csrrd	t1, LOONGARCH_CSR_PRMD
803b0fc5c3f2ba Huacai Chen 2022-05-31  20  	stptr.d	t1, a0, THREAD_CSRPRMD
803b0fc5c3f2ba Huacai Chen 2022-05-31  21  
803b0fc5c3f2ba Huacai Chen 2022-05-31  22  	cpu_save_nonscratch a0
803b0fc5c3f2ba Huacai Chen 2022-05-31  23  	stptr.d	ra, a0, THREAD_REG01
93a4fa622eb061 Qing Zhang  2022-08-06  24  	stptr.d a3, a0, THREAD_SCHED_RA
93a4fa622eb061 Qing Zhang  2022-08-06  25  	stptr.d a4, a0, THREAD_SCHED_CFA
09f33601bf940f Huacai Chen 2022-12-10  26  #if defined(CONFIG_STACKPROTECTOR) && !defined(CONFIG_SMP)
09f33601bf940f Huacai Chen 2022-12-10  27  	la	t7, __stack_chk_guard
Quoted 8 lines

09f33601bf940f Huacai Chen 2022-12-10 @28 LONG_L t8, a1, TASK_STACK_CANARY

:::::: The code at line 28 was first introduced by commit
:::::: 09f33601bf940f955c10a6e75a1c1b7bcadee5e2 LoongArch: Add basic STACKPROTECTOR support

:::::: TO: Huacai Chen <[email protected]>
:::::: CC: Huacai Chen <[email protected]>

Hi,

This appears unrelated to the commit and looks like LoongArch assembly issue.

CC LoongArch maintainers.

Thanks,
Shivank