Skip to content

Commit c313761

Browse files
committed
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"
2 parents 7d2f353 + 9730870 commit c313761

File tree

22 files changed

+42
-38
lines changed

22 files changed

+42
-38
lines changed

arch/loongarch/Kconfig

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -662,5 +662,3 @@ source "kernel/power/Kconfig"
662662
source "drivers/acpi/Kconfig"
663663

664664
endmenu
665-
666-
source "drivers/firmware/Kconfig"

arch/loongarch/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ KBUILD_CFLAGS_KERNEL += -fPIE
8383
LDFLAGS_vmlinux += -static -pie --no-dynamic-linker -z notext
8484
endif
8585

86-
cflags-y += -ffreestanding
8786
cflags-y += $(call cc-option, -mno-check-zero-division)
87+
cflags-y += -fno-builtin-memcpy -fno-builtin-memmove -fno-builtin-memset
8888

8989
load-y = 0x9000000000200000
9090
bootvars-y = VMLINUX_LOAD_ADDRESS=$(load-y)

arch/loongarch/include/asm/Kbuild

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# SPDX-License-Identifier: GPL-2.0
22
generic-y += dma-contiguous.h
3-
generic-y += export.h
43
generic-y += mcs_spinlock.h
54
generic-y += parport.h
65
generic-y += early_ioremap.h

arch/loongarch/include/asm/fpu.h

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,16 +173,30 @@ static inline void restore_fp(struct task_struct *tsk)
173173
_restore_fp(&tsk->thread.fpu);
174174
}
175175

176-
static inline union fpureg *get_fpu_regs(struct task_struct *tsk)
176+
static inline void save_fpu_regs(struct task_struct *tsk)
177177
{
178+
unsigned int euen;
179+
178180
if (tsk == current) {
179181
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)
181196
_save_fp(&current->thread.fpu);
197+
182198
preempt_enable();
183199
}
184-
185-
return tsk->thread.fpu.fpr;
186200
}
187201

188202
static inline int is_simd_owner(void)

arch/loongarch/include/asm/ptrace.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ static inline void regs_set_return_value(struct pt_regs *regs, unsigned long val
162162
#define instruction_pointer(regs) ((regs)->csr_era)
163163
#define profile_pc(regs) instruction_pointer(regs)
164164

165-
extern void die(const char *, struct pt_regs *) __noreturn;
165+
extern void die(const char *str, struct pt_regs *regs);
166166

167167
static inline void die_if_kernel(const char *str, struct pt_regs *regs)
168168
{

arch/loongarch/include/asm/smp.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,6 @@ static inline void __cpu_die(unsigned int cpu)
9898
{
9999
loongson_cpu_die(cpu);
100100
}
101-
102-
extern void __noreturn play_dead(void);
103101
#endif
104102

105103
#endif /* __ASM_SMP_H */

arch/loongarch/kernel/fpu.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
*
77
* Copyright (C) 2020-2022 Loongson Technology Corporation Limited
88
*/
9+
#include <linux/export.h>
910
#include <asm/asm.h>
1011
#include <asm/asmmacro.h>
1112
#include <asm/asm-extable.h>
1213
#include <asm/asm-offsets.h>
1314
#include <asm/errno.h>
14-
#include <asm/export.h>
1515
#include <asm/fpregdef.h>
1616
#include <asm/loongarch.h>
1717
#include <asm/regdef.h>

arch/loongarch/kernel/hw_breakpoint.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,7 @@ static int hw_breakpoint_control(struct perf_event *bp,
207207
write_wb_reg(CSR_CFG_CTRL, i, 0, CTRL_PLV_ENABLE);
208208
} else {
209209
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);
212211
}
213212
enable = csr_read64(LOONGARCH_CSR_CRMD);
214213
csr_write64(CSR_CRMD_WE | enable, LOONGARCH_CSR_CRMD);

arch/loongarch/kernel/mcount.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Copyright (C) 2022 Loongson Technology Corporation Limited
66
*/
77

8-
#include <asm/export.h>
8+
#include <linux/export.h>
99
#include <asm/ftrace.h>
1010
#include <asm/regdef.h>
1111
#include <asm/stackframe.h>

arch/loongarch/kernel/mcount_dyn.S

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* Copyright (C) 2022 Loongson Technology Corporation Limited
44
*/
55

6-
#include <asm/export.h>
76
#include <asm/ftrace.h>
87
#include <asm/regdef.h>
98
#include <asm/stackframe.h>

0 commit comments

Comments
 (0)