Commit 81bcd4b5 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'loongarch-fixes-6.0-3' of...

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

Pull LoongArch fixes from Huacai Chen:
 "Some trivial fixes and cleanup"

* tag 'loongarch-fixes-6.0-3' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson:
  LoongArch: Clean up loongson3_smp_ops declaration
  LoongArch: Fix and cleanup csr_era handling in do_ri()
  LoongArch: Align the address of kernel_entry to 4KB
parents c3e0e1e2 4f196cb6
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -14,8 +14,6 @@
#include <asm/addrspace.h>
#include <asm/bootinfo.h>

extern const struct plat_smp_ops loongson3_smp_ops;

#define LOONGSON_REG(x) \
	(*(volatile u32 *)((char *)TO_UNCACHE(LOONGSON_REG_BASE) + (x)))

+2 −0
Original line number Diff line number Diff line
@@ -14,6 +14,8 @@

	__REF

	.align 12

SYM_CODE_START(kernel_entry)			# kernel entry point

	/* Config direct window and set PG */
+2 −13
Original line number Diff line number Diff line
@@ -461,11 +461,9 @@ asmlinkage void noinstr do_watch(struct pt_regs *regs)

asmlinkage void noinstr do_ri(struct pt_regs *regs)
{
	int status = -1;
	int status = SIGILL;
	unsigned int opcode = 0;
	unsigned int __user *era = (unsigned int __user *)exception_era(regs);
	unsigned long old_era = regs->csr_era;
	unsigned long old_ra = regs->regs[1];
	irqentry_state_t state = irqentry_enter(regs);

	local_irq_enable();
@@ -477,21 +475,12 @@ asmlinkage void noinstr do_ri(struct pt_regs *regs)

	die_if_kernel("Reserved instruction in kernel code", regs);

	compute_return_era(regs);

	if (unlikely(get_user(opcode, era) < 0)) {
		status = SIGSEGV;
		current->thread.error_code = 1;
	}

	if (status < 0)
		status = SIGILL;

	if (unlikely(status > 0)) {
		regs->csr_era = old_era;		/* Undo skip-over.  */
		regs->regs[1] = old_ra;
	force_sig(status);
	}

out:
	local_irq_disable();