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

Pull LoongArch fixes from Huacai Chen:
"Fix a ptrace bug, a hw_breakpoint bug, some build errors/warnings and
some trivial cleanups"

* tag 'loongarch-fixes-6.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson:
LoongArch: Fix hw_breakpoint_control() for watchpoints
LoongArch: Ensure FP/SIMD registers in the core dump file is up to date
LoongArch: Put the body of play_dead() into arch_cpu_idle_dead()
LoongArch: Add identifier names to arguments of die() declaration
LoongArch: Return earlier in die() if notify_die() returns NOTIFY_STOP
LoongArch: Do not kill the task in die() if notify_die() returns NOTIFY_STOP
LoongArch: Remove <asm/export.h>
LoongArch: Replace #include <asm/export.h> with #include <linux/export.h>
LoongArch: Remove unneeded #include <asm/export.h>
LoongArch: Replace -ffreestanding with finer-grained -fno-builtin's
LoongArch: Remove redundant "source drivers/firmware/Kconfig"

+42 -38
-2
arch/loongarch/Kconfig
··· 662 662 source "drivers/acpi/Kconfig" 663 663 664 664 endmenu 665 - 666 - source "drivers/firmware/Kconfig"
+1 -1
arch/loongarch/Makefile
··· 83 83 LDFLAGS_vmlinux += -static -pie --no-dynamic-linker -z notext 84 84 endif 85 85 86 - cflags-y += -ffreestanding 87 86 cflags-y += $(call cc-option, -mno-check-zero-division) 87 + cflags-y += -fno-builtin-memcpy -fno-builtin-memmove -fno-builtin-memset 88 88 89 89 load-y = 0x9000000000200000 90 90 bootvars-y = VMLINUX_LOAD_ADDRESS=$(load-y)
-1
arch/loongarch/include/asm/Kbuild
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 generic-y += dma-contiguous.h 3 - generic-y += export.h 4 3 generic-y += mcs_spinlock.h 5 4 generic-y += parport.h 6 5 generic-y += early_ioremap.h
+18 -4
arch/loongarch/include/asm/fpu.h
··· 173 173 _restore_fp(&tsk->thread.fpu); 174 174 } 175 175 176 - static inline union fpureg *get_fpu_regs(struct task_struct *tsk) 176 + static inline void save_fpu_regs(struct task_struct *tsk) 177 177 { 178 + unsigned int euen; 179 + 178 180 if (tsk == current) { 179 181 preempt_disable(); 180 - if (is_fpu_owner()) 182 + 183 + euen = csr_read32(LOONGARCH_CSR_EUEN); 184 + 185 + #ifdef CONFIG_CPU_HAS_LASX 186 + if (euen & CSR_EUEN_LASXEN) 187 + _save_lasx(&current->thread.fpu); 188 + else 189 + #endif 190 + #ifdef CONFIG_CPU_HAS_LSX 191 + if (euen & CSR_EUEN_LSXEN) 192 + _save_lsx(&current->thread.fpu); 193 + else 194 + #endif 195 + if (euen & CSR_EUEN_FPEN) 181 196 _save_fp(&current->thread.fpu); 197 + 182 198 preempt_enable(); 183 199 } 184 - 185 - return tsk->thread.fpu.fpr; 186 200 } 187 201 188 202 static inline int is_simd_owner(void)
+1 -1
arch/loongarch/include/asm/ptrace.h
··· 162 162 #define instruction_pointer(regs) ((regs)->csr_era) 163 163 #define profile_pc(regs) instruction_pointer(regs) 164 164 165 - extern void die(const char *, struct pt_regs *) __noreturn; 165 + extern void die(const char *str, struct pt_regs *regs); 166 166 167 167 static inline void die_if_kernel(const char *str, struct pt_regs *regs) 168 168 {
-2
arch/loongarch/include/asm/smp.h
··· 98 98 { 99 99 loongson_cpu_die(cpu); 100 100 } 101 - 102 - extern void __noreturn play_dead(void); 103 101 #endif 104 102 105 103 #endif /* __ASM_SMP_H */
+1 -1
arch/loongarch/kernel/fpu.S
··· 6 6 * 7 7 * Copyright (C) 2020-2022 Loongson Technology Corporation Limited 8 8 */ 9 + #include <linux/export.h> 9 10 #include <asm/asm.h> 10 11 #include <asm/asmmacro.h> 11 12 #include <asm/asm-extable.h> 12 13 #include <asm/asm-offsets.h> 13 14 #include <asm/errno.h> 14 - #include <asm/export.h> 15 15 #include <asm/fpregdef.h> 16 16 #include <asm/loongarch.h> 17 17 #include <asm/regdef.h>
+1 -2
arch/loongarch/kernel/hw_breakpoint.c
··· 207 207 write_wb_reg(CSR_CFG_CTRL, i, 0, CTRL_PLV_ENABLE); 208 208 } else { 209 209 ctrl = encode_ctrl_reg(info->ctrl); 210 - write_wb_reg(CSR_CFG_CTRL, i, 1, ctrl | CTRL_PLV_ENABLE | 211 - 1 << MWPnCFG3_LoadEn | 1 << MWPnCFG3_StoreEn); 210 + write_wb_reg(CSR_CFG_CTRL, i, 1, ctrl | CTRL_PLV_ENABLE); 212 211 } 213 212 enable = csr_read64(LOONGARCH_CSR_CRMD); 214 213 csr_write64(CSR_CRMD_WE | enable, LOONGARCH_CSR_CRMD);
+1 -1
arch/loongarch/kernel/mcount.S
··· 5 5 * Copyright (C) 2022 Loongson Technology Corporation Limited 6 6 */ 7 7 8 - #include <asm/export.h> 8 + #include <linux/export.h> 9 9 #include <asm/ftrace.h> 10 10 #include <asm/regdef.h> 11 11 #include <asm/stackframe.h>
-1
arch/loongarch/kernel/mcount_dyn.S
··· 3 3 * Copyright (C) 2022 Loongson Technology Corporation Limited 4 4 */ 5 5 6 - #include <asm/export.h> 7 6 #include <asm/ftrace.h> 8 7 #include <asm/regdef.h> 9 8 #include <asm/stackframe.h>
-7
arch/loongarch/kernel/process.c
··· 61 61 unsigned long boot_option_idle_override = IDLE_NO_OVERRIDE; 62 62 EXPORT_SYMBOL(boot_option_idle_override); 63 63 64 - #ifdef CONFIG_HOTPLUG_CPU 65 - void __noreturn arch_cpu_idle_dead(void) 66 - { 67 - play_dead(); 68 - } 69 - #endif 70 - 71 64 asmlinkage void ret_from_fork(void); 72 65 asmlinkage void ret_from_kernel_thread(void); 73 66
+4
arch/loongarch/kernel/ptrace.c
··· 147 147 { 148 148 int r; 149 149 150 + save_fpu_regs(target); 151 + 150 152 if (sizeof(target->thread.fpu.fpr[0]) == sizeof(elf_fpreg_t)) 151 153 r = gfpr_get(target, &to); 152 154 else ··· 279 277 struct membuf to) 280 278 { 281 279 const unsigned int wr_size = NUM_FPU_REGS * regset->size; 280 + 281 + save_fpu_regs(target); 282 282 283 283 if (!tsk_used_math(target)) { 284 284 /* The task hasn't used FP or LSX, fill with 0xff */
+1 -1
arch/loongarch/kernel/smp.c
··· 317 317 mb(); 318 318 } 319 319 320 - void play_dead(void) 320 + void __noreturn arch_cpu_idle_dead(void) 321 321 { 322 322 register uint64_t addr; 323 323 register void (*init_fn)(void);
+8 -6
arch/loongarch/kernel/traps.c
··· 383 383 384 384 static DEFINE_RAW_SPINLOCK(die_lock); 385 385 386 - void __noreturn die(const char *str, struct pt_regs *regs) 386 + void die(const char *str, struct pt_regs *regs) 387 387 { 388 + int ret; 388 389 static int die_counter; 389 - int sig = SIGSEGV; 390 390 391 391 oops_enter(); 392 392 393 - if (notify_die(DIE_OOPS, str, regs, 0, current->thread.trap_nr, 394 - SIGSEGV) == NOTIFY_STOP) 395 - sig = 0; 393 + ret = notify_die(DIE_OOPS, str, regs, 0, 394 + current->thread.trap_nr, SIGSEGV); 396 395 397 396 console_verbose(); 398 397 raw_spin_lock_irq(&die_lock); ··· 404 405 405 406 oops_exit(); 406 407 408 + if (ret == NOTIFY_STOP) 409 + return; 410 + 407 411 if (regs && kexec_should_crash(current)) 408 412 crash_kexec(regs); 409 413 ··· 416 414 if (panic_on_oops) 417 415 panic("Fatal exception"); 418 416 419 - make_task_dead(sig); 417 + make_task_dead(SIGSEGV); 420 418 } 421 419 422 420 static inline void setup_vint_size(unsigned int size)
+1 -1
arch/loongarch/lib/clear_user.S
··· 3 3 * Copyright (C) 2020-2022 Loongson Technology Corporation Limited 4 4 */ 5 5 6 + #include <linux/export.h> 6 7 #include <asm/alternative-asm.h> 7 8 #include <asm/asm.h> 8 9 #include <asm/asmmacro.h> 9 10 #include <asm/asm-extable.h> 10 11 #include <asm/cpu.h> 11 - #include <asm/export.h> 12 12 #include <asm/regdef.h> 13 13 14 14 .irp to, 0, 1, 2, 3, 4, 5, 6, 7
+1 -1
arch/loongarch/lib/copy_user.S
··· 3 3 * Copyright (C) 2020-2022 Loongson Technology Corporation Limited 4 4 */ 5 5 6 + #include <linux/export.h> 6 7 #include <asm/alternative-asm.h> 7 8 #include <asm/asm.h> 8 9 #include <asm/asmmacro.h> 9 10 #include <asm/asm-extable.h> 10 11 #include <asm/cpu.h> 11 - #include <asm/export.h> 12 12 #include <asm/regdef.h> 13 13 14 14 .irp to, 0, 1, 2, 3, 4, 5, 6, 7
+1 -1
arch/loongarch/lib/memcpy.S
··· 3 3 * Copyright (C) 2020-2022 Loongson Technology Corporation Limited 4 4 */ 5 5 6 + #include <linux/export.h> 6 7 #include <asm/alternative-asm.h> 7 8 #include <asm/asm.h> 8 9 #include <asm/asmmacro.h> 9 10 #include <asm/cpu.h> 10 - #include <asm/export.h> 11 11 #include <asm/regdef.h> 12 12 13 13 SYM_FUNC_START(memcpy)
+1 -1
arch/loongarch/lib/memmove.S
··· 3 3 * Copyright (C) 2020-2022 Loongson Technology Corporation Limited 4 4 */ 5 5 6 + #include <linux/export.h> 6 7 #include <asm/alternative-asm.h> 7 8 #include <asm/asm.h> 8 9 #include <asm/asmmacro.h> 9 10 #include <asm/cpu.h> 10 - #include <asm/export.h> 11 11 #include <asm/regdef.h> 12 12 13 13 SYM_FUNC_START(memmove)
+1 -1
arch/loongarch/lib/memset.S
··· 3 3 * Copyright (C) 2020-2022 Loongson Technology Corporation Limited 4 4 */ 5 5 6 + #include <linux/export.h> 6 7 #include <asm/alternative-asm.h> 7 8 #include <asm/asm.h> 8 9 #include <asm/asmmacro.h> 9 10 #include <asm/cpu.h> 10 - #include <asm/export.h> 11 11 #include <asm/regdef.h> 12 12 13 13 .macro fill_to_64 r0
-1
arch/loongarch/lib/unaligned.S
··· 9 9 #include <asm/asmmacro.h> 10 10 #include <asm/asm-extable.h> 11 11 #include <asm/errno.h> 12 - #include <asm/export.h> 13 12 #include <asm/regdef.h> 14 13 15 14 .L_fixup_handle_unaligned:
+1 -1
arch/loongarch/mm/page.S
··· 2 2 /* 3 3 * Copyright (C) 2020-2022 Loongson Technology Corporation Limited 4 4 */ 5 + #include <linux/export.h> 5 6 #include <linux/linkage.h> 6 7 #include <asm/asm.h> 7 - #include <asm/export.h> 8 8 #include <asm/page.h> 9 9 #include <asm/regdef.h> 10 10
-1
arch/loongarch/mm/tlbex.S
··· 3 3 * Copyright (C) 2020-2022 Loongson Technology Corporation Limited 4 4 */ 5 5 #include <asm/asm.h> 6 - #include <asm/export.h> 7 6 #include <asm/loongarch.h> 8 7 #include <asm/page.h> 9 8 #include <asm/pgtable.h>