Commit e4d82692 authored by Martin Schwidefsky's avatar Martin Schwidefsky Committed by Martin Schwidefsky

[S390] missing sacf in uaccess

The uaccess functions copy_in_user_std and clear_user_std fail to
switch back from secondary space mode to primary space mode with sacf
in case of an unresolvable page fault. We need to make sure that the
switch back to primary mode is done in all cases, otherwise the code
following the uaccess inline assembly will crash.
Reported-by: default avatarAlexander Graf <agraf@suse.de>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent f1be77bb
...@@ -125,9 +125,9 @@ static size_t copy_in_user_std(size_t size, void __user *to, ...@@ -125,9 +125,9 @@ static size_t copy_in_user_std(size_t size, void __user *to,
unsigned long tmp1; unsigned long tmp1;
asm volatile( asm volatile(
" sacf 256\n"
" "AHI" %0,-1\n" " "AHI" %0,-1\n"
" jo 5f\n" " jo 5f\n"
" sacf 256\n"
" bras %3,3f\n" " bras %3,3f\n"
"0:"AHI" %0,257\n" "0:"AHI" %0,257\n"
"1: mvc 0(1,%1),0(%2)\n" "1: mvc 0(1,%1),0(%2)\n"
...@@ -142,9 +142,8 @@ static size_t copy_in_user_std(size_t size, void __user *to, ...@@ -142,9 +142,8 @@ static size_t copy_in_user_std(size_t size, void __user *to,
"3:"AHI" %0,-256\n" "3:"AHI" %0,-256\n"
" jnm 2b\n" " jnm 2b\n"
"4: ex %0,1b-0b(%3)\n" "4: ex %0,1b-0b(%3)\n"
" sacf 0\n"
"5: "SLR" %0,%0\n" "5: "SLR" %0,%0\n"
"6:\n" "6: sacf 0\n"
EX_TABLE(1b,6b) EX_TABLE(2b,0b) EX_TABLE(4b,0b) EX_TABLE(1b,6b) EX_TABLE(2b,0b) EX_TABLE(4b,0b)
: "+a" (size), "+a" (to), "+a" (from), "=a" (tmp1) : "+a" (size), "+a" (to), "+a" (from), "=a" (tmp1)
: : "cc", "memory"); : : "cc", "memory");
...@@ -156,9 +155,9 @@ static size_t clear_user_std(size_t size, void __user *to) ...@@ -156,9 +155,9 @@ static size_t clear_user_std(size_t size, void __user *to)
unsigned long tmp1, tmp2; unsigned long tmp1, tmp2;
asm volatile( asm volatile(
" sacf 256\n"
" "AHI" %0,-1\n" " "AHI" %0,-1\n"
" jo 5f\n" " jo 5f\n"
" sacf 256\n"
" bras %3,3f\n" " bras %3,3f\n"
" xc 0(1,%1),0(%1)\n" " xc 0(1,%1),0(%1)\n"
"0:"AHI" %0,257\n" "0:"AHI" %0,257\n"
...@@ -178,9 +177,8 @@ static size_t clear_user_std(size_t size, void __user *to) ...@@ -178,9 +177,8 @@ static size_t clear_user_std(size_t size, void __user *to)
"3:"AHI" %0,-256\n" "3:"AHI" %0,-256\n"
" jnm 2b\n" " jnm 2b\n"
"4: ex %0,0(%3)\n" "4: ex %0,0(%3)\n"
" sacf 0\n"
"5: "SLR" %0,%0\n" "5: "SLR" %0,%0\n"
"6:\n" "6: sacf 0\n"
EX_TABLE(1b,6b) EX_TABLE(2b,0b) EX_TABLE(4b,0b) EX_TABLE(1b,6b) EX_TABLE(2b,0b) EX_TABLE(4b,0b)
: "+a" (size), "+a" (to), "=a" (tmp1), "=a" (tmp2) : "+a" (size), "+a" (to), "=a" (tmp1), "=a" (tmp2)
: : "cc", "memory"); : : "cc", "memory");
......
Markdown is supported
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