summaryrefslogtreecommitdiffstats
path: root/arch/xtensa/include/asm/uaccess.h
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2014-07-27 05:23:41 +0200
committerMax Filippov <jcmvbkbc@gmail.com>2014-08-14 09:59:16 +0200
commit52247123749cc3cbc30168b33ad8c69515c96d23 (patch)
tree2bdc9346c7ce61227d7d68e12aace9b130406bcb /arch/xtensa/include/asm/uaccess.h
parentxtensa: add renameat2 syscall (diff)
downloadlinux-52247123749cc3cbc30168b33ad8c69515c96d23.tar.xz
linux-52247123749cc3cbc30168b33ad8c69515c96d23.zip
xtensa: fix access to THREAD_RA/THREAD_SP/THREAD_DS
With SMP and a lot of debug options enabled task_struct::thread gets out of reach of s32i/l32i instructions with base pointing at task_struct, breaking build with the following messages: arch/xtensa/kernel/entry.S: Assembler messages: arch/xtensa/kernel/entry.S:1002: Error: operand 3 of 'l32i.n' has invalid value '1048' arch/xtensa/kernel/entry.S:1831: Error: operand 3 of 's32i.n' has invalid value '1040' arch/xtensa/kernel/entry.S:1832: Error: operand 3 of 's32i.n' has invalid value '1044' Change base to point to task_struct::thread in such cases. Don't use a10 in _switch_to to save/restore prev pointer as a2 is not clobbered. Cc: stable@vger.kernel.org Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'arch/xtensa/include/asm/uaccess.h')
-rw-r--r--arch/xtensa/include/asm/uaccess.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/xtensa/include/asm/uaccess.h b/arch/xtensa/include/asm/uaccess.h
index fd686dc45d1a..c7211e7e182d 100644
--- a/arch/xtensa/include/asm/uaccess.h
+++ b/arch/xtensa/include/asm/uaccess.h
@@ -52,7 +52,12 @@
*/
.macro get_fs ad, sp
GET_CURRENT(\ad,\sp)
+#if THREAD_CURRENT_DS > 1020
+ addi \ad, \ad, TASK_THREAD
+ l32i \ad, \ad, THREAD_CURRENT_DS - TASK_THREAD
+#else
l32i \ad, \ad, THREAD_CURRENT_DS
+#endif
.endm
/*