Skip to content

Commit 812489a

Browse files
committed
openrisc: Properly store r31 to pt_regs on unhandled exceptions
In commit 91993c8 ("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: 91993c8 ("openrisc: use shadow registers to save regs on exception") Signed-off-by: Stafford Horne <shorne@gmail.com>
1 parent 1aff44a commit 812489a

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

arch/openrisc/kernel/entry.S

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ handler: ;\
173173
l.sw PT_GPR28(r1),r28 ;\
174174
l.sw PT_GPR29(r1),r29 ;\
175175
/* r30 already save */ ;\
176-
/* l.sw PT_GPR30(r1),r30*/ ;\
177176
l.sw PT_GPR31(r1),r31 ;\
178177
TRACE_IRQS_OFF_ENTRY ;\
179178
/* Store -1 in orig_gpr11 for non-syscall exceptions */ ;\
@@ -211,9 +210,8 @@ handler: ;\
211210
l.sw PT_GPR27(r1),r27 ;\
212211
l.sw PT_GPR28(r1),r28 ;\
213212
l.sw PT_GPR29(r1),r29 ;\
214-
/* r31 already saved */ ;\
215-
l.sw PT_GPR30(r1),r30 ;\
216-
/* l.sw PT_GPR31(r1),r31 */ ;\
213+
/* r30 already saved */ ;\
214+
l.sw PT_GPR31(r1),r31 ;\
217215
/* Store -1 in orig_gpr11 for non-syscall exceptions */ ;\
218216
l.addi r30,r0,-1 ;\
219217
l.sw PT_ORIG_GPR11(r1),r30 ;\

0 commit comments

Comments
 (0)