LoongArch fixes for v6.0-final

-----BEGIN PGP SIGNATURE-----
 
 iQJKBAABCAA0FiEEzOlt8mkP+tbeiYy5AoYrw/LiJnoFAmM1AJcWHGNoZW5odWFj
 YWlAa2VybmVsLm9yZwAKCRAChivD8uImekA3D/46J/vg5BVdGJxPxDXd6HUtPjX+
 lkRs/yfGwntxKr1bQeEp0/p5W1ht9M2vtLQfUuPuXL1ArTTJ0F61jqkc4Pz9Ulzw
 pcQA6pMfwXjpxJqDzNfDZ3Zq17DD5KOkQyPT7MuJpO7AbX3aiaLAZ6C+cjckrBLV
 tKNIm8nIcCfcvivOnkP+1oaazmc2ndxQBozmiTcGTuy4Gsyyj2Qyibqjm9RQvDoH
 zD87wJKpgTawKN6Gx5nd9F52v7o/HJcQdgYkowVwsnkPrnAU4Wpk9da5XcCmsJ1a
 //YSRZlLHcMDzZqoK1tUrbhTGPxQj03e11XS6uUnzWg/qGjOrvbzFmjmHYd2PJWI
 xuV5IHyXAKwpTVRibFmC184V0XGPuyo9iZJE6/7n06lT2l66+1TDTGa9FRI7EDM+
 BBX6Ye7kVOhqunEy/VXW3pcfAquyWTotGDVYJajFtrBPo/JgoCILh6tGNF4sKGc7
 xeNhZMSjrWIcaSr1C74sTifUx2yYx34f23gt42aJtLq8yCEl0w+sS/dcJ9G2Hj2I
 jKDvq6nQLpsrIw2CYPYUtnsiva4Bug/zBUKeSaWc91C2LuPPgOqZdvSj+bVaAJWz
 ulPd6DaTkAK1aoNm/3+veL0/GQlLFDUyHHI9YDpYN52BmNlZfZJ0ffV3KHkxuFkV
 dbGT6ZEXjrf0oMaHFQ==
 =q6CX
 -----END PGP SIGNATURE-----

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
This commit is contained in:
Linus Torvalds 2022-09-29 05:35:32 -07:00
commit 81bcd4b522
3 changed files with 4 additions and 15 deletions

View File

@ -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)))

View File

@ -14,6 +14,8 @@
__REF
.align 12
SYM_CODE_START(kernel_entry) # kernel entry point
/* Config direct window and set PG */

View File

@ -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);
}
force_sig(status);
out:
local_irq_disable();