Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'loongarch-fixes-6.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson

Pull LoongArch fixes from Huacai Chen:
"Some bug fixes for build system, builtin cmdline handling, bpf and
{copy, clear}_user, together with a trivial cleanup"

* tag 'loongarch-fixes-6.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson:
LoongArch: Cleanup __builtin_constant_p() checking for cpu_has_*
LoongArch: BPF: Fix check condition to call lu32id in move_imm()
LoongArch: BPF: Enable bpf_probe_read{, str}() on LoongArch
LoongArch: Fix return value underflow in exception path
LoongArch: Fix CMDLINE_EXTEND and CMDLINE_BOOTLOADER handling
LoongArch: Fix module relocation error with binutils 2.41
LoongArch: Only fiddle with CHECKFLAGS if `need-compiler'

+29 -15
+1
arch/loongarch/Kconfig
··· 14 14 select ARCH_HAS_CPU_FINALIZE_INIT 15 15 select ARCH_HAS_FORTIFY_SOURCE 16 16 select ARCH_HAS_NMI_SAFE_THIS_CPU_OPS 17 + select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE 17 18 select ARCH_HAS_PTE_SPECIAL 18 19 select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST 19 20 select ARCH_INLINE_READ_LOCK if !PREEMPTION
+3 -1
arch/loongarch/Makefile
··· 68 68 ifdef CONFIG_AS_HAS_EXPLICIT_RELOCS 69 69 cflags-y += $(call cc-option,-mexplicit-relocs) 70 70 KBUILD_CFLAGS_KERNEL += $(call cc-option,-mdirect-extern-access) 71 + KBUILD_AFLAGS_MODULE += $(call cc-option,-mno-relax) $(call cc-option,-Wa$(comma)-mno-relax) 72 + KBUILD_CFLAGS_MODULE += $(call cc-option,-mno-relax) $(call cc-option,-Wa$(comma)-mno-relax) 71 73 else 72 74 cflags-y += $(call cc-option,-mno-explicit-relocs) 73 75 KBUILD_AFLAGS_KERNEL += -Wa,-mla-global-with-pcrel ··· 113 111 114 112 KBUILD_LDFLAGS += -m $(ld-emul) 115 113 116 - ifdef CONFIG_LOONGARCH 114 + ifdef need-compiler 117 115 CHECKFLAGS += $(shell $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -dM -E -x c /dev/null | \ 118 116 grep -E -vw '__GNUC_(MINOR_|PATCHLEVEL_)?_' | \ 119 117 sed -e "s/^\#define /-D'/" -e "s/ /'='/" -e "s/$$/'/" -e 's/\$$/&&/g')
+4 -11
arch/loongarch/include/asm/fpu.h
··· 218 218 219 219 static inline void init_lsx_upper(void) 220 220 { 221 - /* 222 - * Check cpu_has_lsx only if it's a constant. This will allow the 223 - * compiler to optimise out code for CPUs without LSX without adding 224 - * an extra redundant check for CPUs with LSX. 225 - */ 226 - if (__builtin_constant_p(cpu_has_lsx) && !cpu_has_lsx) 227 - return; 228 - 229 - _init_lsx_upper(); 221 + if (cpu_has_lsx) 222 + _init_lsx_upper(); 230 223 } 231 224 232 225 static inline void restore_lsx_upper(struct task_struct *t) ··· 287 294 288 295 static inline int thread_lsx_context_live(void) 289 296 { 290 - if (__builtin_constant_p(cpu_has_lsx) && !cpu_has_lsx) 297 + if (!cpu_has_lsx) 291 298 return 0; 292 299 293 300 return test_thread_flag(TIF_LSX_CTX_LIVE); ··· 295 302 296 303 static inline int thread_lasx_context_live(void) 297 304 { 298 - if (__builtin_constant_p(cpu_has_lasx) && !cpu_has_lasx) 305 + if (!cpu_has_lasx) 299 306 return 0; 300 307 301 308 return test_thread_flag(TIF_LASX_CTX_LIVE);
+16
arch/loongarch/kernel/setup.c
··· 332 332 strlcat(boot_command_line, " ", COMMAND_LINE_SIZE); 333 333 334 334 strlcat(boot_command_line, init_command_line, COMMAND_LINE_SIZE); 335 + goto out; 335 336 } 336 337 #endif 338 + 339 + /* 340 + * Append built-in command line to the bootloader command line if 341 + * CONFIG_CMDLINE_EXTEND is enabled. 342 + */ 343 + if (IS_ENABLED(CONFIG_CMDLINE_EXTEND) && CONFIG_CMDLINE[0]) { 344 + strlcat(boot_command_line, " ", COMMAND_LINE_SIZE); 345 + strlcat(boot_command_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE); 346 + } 347 + 348 + /* 349 + * Use built-in command line if the bootloader command line is empty. 350 + */ 351 + if (IS_ENABLED(CONFIG_CMDLINE_BOOTLOADER) && !boot_command_line[0]) 352 + strscpy(boot_command_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE); 337 353 338 354 out: 339 355 *cmdline_p = boot_command_line;
+2 -1
arch/loongarch/lib/clear_user.S
··· 108 108 addi.d a3, a2, -8 109 109 bgeu a0, a3, .Llt8 110 110 15: st.d zero, a0, 0 111 + addi.d a0, a0, 8 111 112 112 113 .Llt8: 113 114 16: st.d zero, a2, -8 ··· 189 188 _asm_extable 13b, .L_fixup_handle_0 190 189 _asm_extable 14b, .L_fixup_handle_1 191 190 _asm_extable 15b, .L_fixup_handle_0 192 - _asm_extable 16b, .L_fixup_handle_1 191 + _asm_extable 16b, .L_fixup_handle_0 193 192 _asm_extable 17b, .L_fixup_handle_s0 194 193 _asm_extable 18b, .L_fixup_handle_s0 195 194 _asm_extable 19b, .L_fixup_handle_s0
+2 -1
arch/loongarch/lib/copy_user.S
··· 136 136 bgeu a1, a4, .Llt8 137 137 30: ld.d t0, a1, 0 138 138 31: st.d t0, a0, 0 139 + addi.d a0, a0, 8 139 140 140 141 .Llt8: 141 142 32: ld.d t0, a3, -8 ··· 247 246 _asm_extable 30b, .L_fixup_handle_0 248 247 _asm_extable 31b, .L_fixup_handle_0 249 248 _asm_extable 32b, .L_fixup_handle_0 250 - _asm_extable 33b, .L_fixup_handle_1 249 + _asm_extable 33b, .L_fixup_handle_0 251 250 _asm_extable 34b, .L_fixup_handle_s0 252 251 _asm_extable 35b, .L_fixup_handle_s0 253 252 _asm_extable 36b, .L_fixup_handle_s0
+1 -1
arch/loongarch/net/bpf_jit.h
··· 150 150 * no need to call lu32id to do a new filled operation. 151 151 */ 152 152 imm_51_31 = (imm >> 31) & 0x1fffff; 153 - if (imm_51_31 != 0 || imm_51_31 != 0x1fffff) { 153 + if (imm_51_31 != 0 && imm_51_31 != 0x1fffff) { 154 154 /* lu32id rd, imm_51_32 */ 155 155 imm_51_32 = (imm >> 32) & 0xfffff; 156 156 emit_insn(ctx, lu32id, rd, imm_51_32);