Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
Commit 19f6dcb1 authored by Max Filippov's avatar Max Filippov Committed by Greg Kroah-Hartman
Browse files

xtensa: fix a7 clobbering in coprocessor context load/store

commit 839769c3 upstream.

Fast coprocessor exception handler saves a3..a6, but coprocessor context
load/store code uses a4..a7 as temporaries, potentially clobbering a7.
'Potentially' because coprocessor state load/store macros may not use
all four temporary registers (and neither FPU nor HiFi macros do).
Use a3..a6 as intended.

Cc: stable@vger.kernel.org
Fixes: c658eac6

 ("[XTENSA] Add support for configurable registers and coprocessors")
Signed-off-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f399ab11
No related merge requests found
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
.if XTENSA_HAVE_COPROCESSOR(x); \ .if XTENSA_HAVE_COPROCESSOR(x); \
.align 4; \ .align 4; \
.Lsave_cp_regs_cp##x: \ .Lsave_cp_regs_cp##x: \
xchal_cp##x##_store a2 a4 a5 a6 a7; \ xchal_cp##x##_store a2 a3 a4 a5 a6; \
jx a0; \ jx a0; \
.endif .endif
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
.if XTENSA_HAVE_COPROCESSOR(x); \ .if XTENSA_HAVE_COPROCESSOR(x); \
.align 4; \ .align 4; \
.Lload_cp_regs_cp##x: \ .Lload_cp_regs_cp##x: \
xchal_cp##x##_load a2 a4 a5 a6 a7; \ xchal_cp##x##_load a2 a3 a4 a5 a6; \
jx a0; \ jx a0; \
.endif .endif
......
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