Commit c3137613 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'loongarch-fixes-6.5-2' of...

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"
parents 7d2f353b 9730870b
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -662,5 +662,3 @@ source "kernel/power/Kconfig"
source "drivers/acpi/Kconfig"

endmenu

source "drivers/firmware/Kconfig"
+1 −1
Original line number Diff line number Diff line
@@ -83,8 +83,8 @@ KBUILD_CFLAGS_KERNEL += -fPIE
LDFLAGS_vmlinux			+= -static -pie --no-dynamic-linker -z notext
endif

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

load-y		= 0x9000000000200000
bootvars-y	= VMLINUX_LOAD_ADDRESS=$(load-y)
+0 −1
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0
generic-y += dma-contiguous.h
generic-y += export.h
generic-y += mcs_spinlock.h
generic-y += parport.h
generic-y += early_ioremap.h
+18 −4
Original line number Diff line number Diff line
@@ -173,16 +173,30 @@ static inline void restore_fp(struct task_struct *tsk)
		_restore_fp(&tsk->thread.fpu);
}

static inline union fpureg *get_fpu_regs(struct task_struct *tsk)
static inline void save_fpu_regs(struct task_struct *tsk)
{
	unsigned int euen;

	if (tsk == current) {
		preempt_disable();
		if (is_fpu_owner())

		euen = csr_read32(LOONGARCH_CSR_EUEN);

#ifdef CONFIG_CPU_HAS_LASX
		if (euen & CSR_EUEN_LASXEN)
			_save_lasx(&current->thread.fpu);
		else
#endif
#ifdef CONFIG_CPU_HAS_LSX
		if (euen & CSR_EUEN_LSXEN)
			_save_lsx(&current->thread.fpu);
		else
#endif
		if (euen & CSR_EUEN_FPEN)
			_save_fp(&current->thread.fpu);

		preempt_enable();
	}

	return tsk->thread.fpu.fpr;
}

static inline int is_simd_owner(void)
+1 −1
Original line number Diff line number Diff line
@@ -162,7 +162,7 @@ static inline void regs_set_return_value(struct pt_regs *regs, unsigned long val
#define instruction_pointer(regs) ((regs)->csr_era)
#define profile_pc(regs) instruction_pointer(regs)

extern void die(const char *, struct pt_regs *) __noreturn;
extern void die(const char *str, struct pt_regs *regs);

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