summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorStafford Horne <shorne@gmail.com>2023-02-11 19:14:06 +0900
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-05-17 11:13:19 +0200
commit1234be447d32cc8b086200bddb3a14bd29a8df3b (patch)
tree9bf2fb4f4c03d96ef7afc79ed1f9cc645a6708de /arch
parent9b710c80976cc43a369bab7278ea9baa926153a8 (diff)
downloadlinux-stable-1234be447d32cc8b086200bddb3a14bd29a8df3b.tar.gz
linux-stable-1234be447d32cc8b086200bddb3a14bd29a8df3b.tar.bz2
linux-stable-1234be447d32cc8b086200bddb3a14bd29a8df3b.zip
openrisc: Properly store r31 to pt_regs on unhandled exceptions
[ Upstream commit 812489ac4dd91144a74ce65ecf232252a2e406fb ] In commit 91993c8c2ed5 ("openrisc: use shadow registers to save regs on exception") the unhandled exception path was changed to do an early store of r30 instead of r31. The entry code was not updated and r31 is not getting stored to pt_regs. This patch updates the entry handler to store r31 instead of r30. We also remove some misleading commented out store r30 and r31 instructrions. I noticed this while working on adding floating point exception handling, This issue probably would never impact anything since we kill the process or Oops right away on unhandled exceptions. Fixes: 91993c8c2ed5 ("openrisc: use shadow registers to save regs on exception") Signed-off-by: Stafford Horne <shorne@gmail.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/openrisc/kernel/entry.S6
1 files changed, 2 insertions, 4 deletions
diff --git a/arch/openrisc/kernel/entry.S b/arch/openrisc/kernel/entry.S
index c2c3ce8a0f84..7b408d67f11e 100644
--- a/arch/openrisc/kernel/entry.S
+++ b/arch/openrisc/kernel/entry.S
@@ -177,7 +177,6 @@ handler: ;\
l.sw PT_GPR28(r1),r28 ;\
l.sw PT_GPR29(r1),r29 ;\
/* r30 already save */ ;\
-/* l.sw PT_GPR30(r1),r30*/ ;\
l.sw PT_GPR31(r1),r31 ;\
TRACE_IRQS_OFF_ENTRY ;\
/* Store -1 in orig_gpr11 for non-syscall exceptions */ ;\
@@ -215,9 +214,8 @@ handler: ;\
l.sw PT_GPR27(r1),r27 ;\
l.sw PT_GPR28(r1),r28 ;\
l.sw PT_GPR29(r1),r29 ;\
- /* r31 already saved */ ;\
- l.sw PT_GPR30(r1),r30 ;\
-/* l.sw PT_GPR31(r1),r31 */ ;\
+ /* r30 already saved */ ;\
+ l.sw PT_GPR31(r1),r31 ;\
/* Store -1 in orig_gpr11 for non-syscall exceptions */ ;\
l.addi r30,r0,-1 ;\
l.sw PT_ORIG_GPR11(r1),r30 ;\