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

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
...@@ -14,8 +14,6 @@ ...@@ -14,8 +14,6 @@
#include <asm/addrspace.h> #include <asm/addrspace.h>
#include <asm/bootinfo.h> #include <asm/bootinfo.h>
extern const struct plat_smp_ops loongson3_smp_ops;
#define LOONGSON_REG(x) \ #define LOONGSON_REG(x) \
(*(volatile u32 *)((char *)TO_UNCACHE(LOONGSON_REG_BASE) + (x))) (*(volatile u32 *)((char *)TO_UNCACHE(LOONGSON_REG_BASE) + (x)))
......
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
__REF __REF
.align 12
SYM_CODE_START(kernel_entry) # kernel entry point SYM_CODE_START(kernel_entry) # kernel entry point
/* Config direct window and set PG */ /* Config direct window and set PG */
......
...@@ -461,11 +461,9 @@ asmlinkage void noinstr do_watch(struct pt_regs *regs) ...@@ -461,11 +461,9 @@ asmlinkage void noinstr do_watch(struct pt_regs *regs)
asmlinkage void noinstr do_ri(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 opcode = 0;
unsigned int __user *era = (unsigned int __user *)exception_era(regs); 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); irqentry_state_t state = irqentry_enter(regs);
local_irq_enable(); local_irq_enable();
...@@ -477,21 +475,12 @@ asmlinkage void noinstr do_ri(struct pt_regs *regs) ...@@ -477,21 +475,12 @@ asmlinkage void noinstr do_ri(struct pt_regs *regs)
die_if_kernel("Reserved instruction in kernel code", regs); die_if_kernel("Reserved instruction in kernel code", regs);
compute_return_era(regs);
if (unlikely(get_user(opcode, era) < 0)) { if (unlikely(get_user(opcode, era) < 0)) {
status = SIGSEGV; status = SIGSEGV;
current->thread.error_code = 1; 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); force_sig(status);
}
out: out:
local_irq_disable(); local_irq_disable();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment