Skip to content

Commit 839769c

Browse files
committed
xtensa: fix a7 clobbering in coprocessor context load/store
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: [email protected] Fixes: c658eac ("[XTENSA] Add support for configurable registers and coprocessors") Signed-off-by: Max Filippov <[email protected]>
1 parent eb5adc7 commit 839769c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/xtensa/kernel/coprocessor.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
.if XTENSA_HAVE_COPROCESSOR(x); \
3030
.align 4; \
3131
.Lsave_cp_regs_cp##x: \
32-
xchal_cp##x##_store a2 a4 a5 a6 a7; \
32+
xchal_cp##x##_store a2 a3 a4 a5 a6; \
3333
jx a0; \
3434
.endif
3535

@@ -46,7 +46,7 @@
4646
.if XTENSA_HAVE_COPROCESSOR(x); \
4747
.align 4; \
4848
.Lload_cp_regs_cp##x: \
49-
xchal_cp##x##_load a2 a4 a5 a6 a7; \
49+
xchal_cp##x##_load a2 a3 a4 a5 a6; \
5050
jx a0; \
5151
.endif
5252

0 commit comments

Comments
 (0)