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.7-2' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson

Pull LoongArch fixes from Huacai Chen:
"Preserve syscall nr across execve(), slightly clean up drdtime(), fix
the Clang built zboot kernel, fix a stack unwinder bug and several bpf
jit bugs"

* tag 'loongarch-fixes-6.7-2' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson:
LoongArch: BPF: Fix unconditional bswap instructions
LoongArch: BPF: Fix sign-extension mov instructions
LoongArch: BPF: Don't sign extend function return value
LoongArch: BPF: Don't sign extend memory load operand
LoongArch: Preserve syscall nr across execve()
LoongArch: Set unwind stack type to unknown rather than set error flag
LoongArch: Slightly clean up drdtime()
LoongArch: Apply dynamic relocations for LLD

+12 -20
+1 -1
arch/loongarch/Makefile
··· 83 83 84 84 ifeq ($(CONFIG_RELOCATABLE),y) 85 85 KBUILD_CFLAGS_KERNEL += -fPIE 86 - LDFLAGS_vmlinux += -static -pie --no-dynamic-linker -z notext 86 + LDFLAGS_vmlinux += -static -pie --no-dynamic-linker -z notext $(call ld-option, --apply-dynamic-relocs) 87 87 endif 88 88 89 89 cflags-y += $(call cc-option, -mno-check-zero-division)
+1 -1
arch/loongarch/include/asm/elf.h
··· 293 293 #define ELF_PLAT_INIT(_r, load_addr) do { \ 294 294 _r->regs[1] = _r->regs[2] = _r->regs[3] = _r->regs[4] = 0; \ 295 295 _r->regs[5] = _r->regs[6] = _r->regs[7] = _r->regs[8] = 0; \ 296 - _r->regs[9] = _r->regs[10] = _r->regs[11] = _r->regs[12] = 0; \ 296 + _r->regs[9] = _r->regs[10] /* syscall n */ = _r->regs[12] = 0; \ 297 297 _r->regs[13] = _r->regs[14] = _r->regs[15] = _r->regs[16] = 0; \ 298 298 _r->regs[17] = _r->regs[18] = _r->regs[19] = _r->regs[20] = 0; \ 299 299 _r->regs[21] = _r->regs[22] = _r->regs[23] = _r->regs[24] = 0; \
+2 -3
arch/loongarch/include/asm/loongarch.h
··· 1098 1098 1099 1099 static __always_inline u64 drdtime(void) 1100 1100 { 1101 - int rID = 0; 1102 1101 u64 val = 0; 1103 1102 1104 1103 __asm__ __volatile__( 1105 - "rdtime.d %0, %1 \n\t" 1106 - : "=r"(val), "=r"(rID) 1104 + "rdtime.d %0, $zero\n\t" 1105 + : "=r"(val) 1107 1106 : 1108 1107 ); 1109 1108 return val;
+1 -1
arch/loongarch/kernel/stacktrace.c
··· 32 32 } 33 33 34 34 for (unwind_start(&state, task, regs); 35 - !unwind_done(&state) && !unwind_error(&state); unwind_next_frame(&state)) { 35 + !unwind_done(&state); unwind_next_frame(&state)) { 36 36 addr = unwind_get_return_address(&state); 37 37 if (!addr || !consume_entry(cookie, addr)) 38 38 break;
-1
arch/loongarch/kernel/unwind.c
··· 28 28 29 29 } while (!get_stack_info(state->sp, state->task, info)); 30 30 31 - state->error = true; 32 31 return false; 33 32 }
+1 -1
arch/loongarch/kernel/unwind_prologue.c
··· 227 227 } while (!get_stack_info(state->sp, state->task, info)); 228 228 229 229 out: 230 - state->error = true; 230 + state->stack_info.type = STACK_TYPE_UNKNOWN; 231 231 return false; 232 232 } 233 233
+6 -12
arch/loongarch/net/bpf_jit.c
··· 480 480 case 8: 481 481 move_reg(ctx, t1, src); 482 482 emit_insn(ctx, extwb, dst, t1); 483 + emit_zext_32(ctx, dst, is32); 483 484 break; 484 485 case 16: 485 486 move_reg(ctx, t1, src); 486 487 emit_insn(ctx, extwh, dst, t1); 488 + emit_zext_32(ctx, dst, is32); 487 489 break; 488 490 case 32: 489 491 emit_insn(ctx, addw, dst, src, LOONGARCH_GPR_ZERO); ··· 774 772 break; 775 773 case 32: 776 774 emit_insn(ctx, revb2w, dst, dst); 777 - /* zero-extend 32 bits into 64 bits */ 778 - emit_zext_32(ctx, dst, is32); 775 + /* clear the upper 32 bits */ 776 + emit_zext_32(ctx, dst, true); 779 777 break; 780 778 case 64: 781 779 emit_insn(ctx, revbd, dst, dst); ··· 913 911 914 912 /* function return */ 915 913 case BPF_JMP | BPF_EXIT: 916 - emit_sext_32(ctx, regmap[BPF_REG_0], true); 917 - 918 914 if (i == ctx->prog->len - 1) 919 915 break; 920 916 ··· 988 988 } 989 989 break; 990 990 case BPF_DW: 991 - if (is_signed_imm12(off)) { 992 - emit_insn(ctx, ldd, dst, src, off); 993 - } else if (is_signed_imm14(off)) { 994 - emit_insn(ctx, ldptrd, dst, src, off); 995 - } else { 996 - move_imm(ctx, t1, off, is32); 997 - emit_insn(ctx, ldxd, dst, src, t1); 998 - } 991 + move_imm(ctx, t1, off, is32); 992 + emit_insn(ctx, ldxd, dst, src, t1); 999 993 break; 1000 994 } 1001 995