[PATCH] xtensa: fix coprocessor_load and coprocessor_restore

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



coprocessor_load and coprocessor_restore incorrectly use factor 4 to
load address of the state loading code from the table where factor 8
must be used.
This results in crash or incorrect coprocessor data when used with
coprocessors 1..7.

Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Max Filippov <jcmvbkbc@xxxxxxxxx>
---
 arch/xtensa/kernel/coprocessor.S | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/xtensa/kernel/coprocessor.S b/arch/xtensa/kernel/coprocessor.S
index 4f8b52d575a2..93ee66322f07 100644
--- a/arch/xtensa/kernel/coprocessor.S
+++ b/arch/xtensa/kernel/coprocessor.S
@@ -137,7 +137,7 @@ ENTRY(coprocessor_load)
 	entry	a1, 32
 	s32i	a0, a1, 0
 	movi	a0, .Lload_cp_regs_jump_table
-	addx4	a3, a3, a0
+	addx8	a3, a3, a0
 	l32i	a3, a3, 0
 	beqz	a3, 1f
 	add	a0, a0, a3
@@ -183,7 +183,7 @@ ENTRY(coprocessor_restore)
 	entry	a1, 32
 	s32i	a0, a1, 0
 	movi	a0, .Lload_cp_regs_jump_table
-	addx4	a3, a3, a0
+	addx8	a3, a3, a0
 	l32i	a4, a3, 4
 	l32i	a3, a3, 0
 	add	a2, a2, a4
-- 
2.11.0




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux