Re: [PATCH v16 14/27] riscv: Implements arch agnostic indirect branch tracking prctls

kernel test robot
2025-05-23T23:06:59Z

Hi Deepak,

kernel test robot noticed the following build errors:

[auto build test ERROR on 4181f8ad7a1061efed0219951d608d4988302af7]

url: https://github.com/intel-lab-lkp/linux/commits/Deepak-Gupta/mm-VM_SHADOW_STACK-definition-for-riscv/20250523-133343
base: 4181f8ad7a1061efed0219951d608d4988302af7
patch link: https://lore.kernel.org/r/20250522-v5_user_cfi_series-v16-14-64f61a35eee7%40rivosinc.com
patch subject: [PATCH v16 14/27] riscv: Implements arch agnostic indirect branch tracking prctls
config: riscv-randconfig-001-20250524 (https://download.01.org/0day-ci/archive/20250524/202505240659.OGVR0xHg-lkp@intel.com/config)
compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project f819f46284f2a79790038e1f6649172789734ae8)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250524/202505240659.OGVR0xHg-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/202505240659.OGVR0xHg-lkp@intel.com/

All errors (new ones prefixed by >>):

>> arch/riscv/kernel/entry.S:172:9: error: immediate must be an integer in the range [-2147483648, 4294967295]
li t0, 0x00040000 | (0x00006000 | 0x00000600) | 0x020000000000
^

vim +172 arch/riscv/kernel/entry.S

155
156 .Lsave_context:
157 REG_S sp, TASK_TI_USER_SP(tp)
158 REG_L sp, TASK_TI_KERNEL_SP(tp)
159 addi sp, sp, -(PT_SIZE_ON_STACK)
160 REG_S x1, PT_RA(sp)
161 REG_S x3, PT_GP(sp)
162 REG_S x5, PT_T0(sp)
163 save_from_x6_to_x31
164
165 /*
166 * Disable user-mode memory access as it should only be set in the
167 * actual user copy routines.
168 *
169 * Disable the FPU/Vector to detect illegal usage of floating point
170 * or vector in kernel space.
171 */
> 172 li t0, SR_SUM | SR_FS_VS | SR_ELP
173
174 REG_L s0, TASK_TI_USER_SP(tp)
175 csrrc s1, CSR_STATUS, t0
176 save_userssp s2, s1
177 csrr s2, CSR_EPC
178 csrr s3, CSR_TVAL
179 csrr s4, CSR_CAUSE
180 csrr s5, CSR_SCRATCH
181 REG_S s0, PT_SP(sp)
182 REG_S s1, PT_STATUS(sp)
183 REG_S s2, PT_EPC(sp)
184 REG_S s3, PT_BADADDR(sp)
185 REG_S s4, PT_CAUSE(sp)
186 REG_S s5, PT_TP(sp)
187
188 /*
189 * Set the scratch register to 0, so that if a recursive exception
190 * occurs, the exception vector knows it came from the kernel
191 */
192 csrw CSR_SCRATCH, x0
193
194 /* Load the global pointer */
195 load_global_pointer
196
197 /* Load the kernel shadow call stack pointer if coming from userspace */
198 scs_load_current_if_task_changed s5
199

--
0-DAY CI Kernel Test Service