diff options
author | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2011-01-31 05:30:05 -0500 |
---|---|---|
committer | Martin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com> | 2011-01-31 05:30:20 -0500 |
commit | e4d82692f4513ccf78de548b8ecea58adf03fa9a (patch) | |
tree | 37651011ab7bdac1de1e5e0fa65d1e6898beb68e /arch/s390 | |
parent | f1be77bb21120b5306b56d6854db1f8eb5c3678b (diff) |
[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: Alexander Graf <agraf@suse.de>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r-- | arch/s390/lib/uaccess_std.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/arch/s390/lib/uaccess_std.c b/arch/s390/lib/uaccess_std.c index 07deaeee14c8..a6c4f7ed24a4 100644 --- a/arch/s390/lib/uaccess_std.c +++ b/arch/s390/lib/uaccess_std.c | |||
@@ -125,9 +125,9 @@ static size_t copy_in_user_std(size_t size, void __user *to, | |||
125 | unsigned long tmp1; | 125 | unsigned long tmp1; |
126 | 126 | ||
127 | asm volatile( | 127 | asm volatile( |
128 | " sacf 256\n" | ||
128 | " "AHI" %0,-1\n" | 129 | " "AHI" %0,-1\n" |
129 | " jo 5f\n" | 130 | " jo 5f\n" |
130 | " sacf 256\n" | ||
131 | " bras %3,3f\n" | 131 | " bras %3,3f\n" |
132 | "0:"AHI" %0,257\n" | 132 | "0:"AHI" %0,257\n" |
133 | "1: mvc 0(1,%1),0(%2)\n" | 133 | "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 | "3:"AHI" %0,-256\n" | 142 | "3:"AHI" %0,-256\n" |
143 | " jnm 2b\n" | 143 | " jnm 2b\n" |
144 | "4: ex %0,1b-0b(%3)\n" | 144 | "4: ex %0,1b-0b(%3)\n" |
145 | " sacf 0\n" | ||
146 | "5: "SLR" %0,%0\n" | 145 | "5: "SLR" %0,%0\n" |
147 | "6:\n" | 146 | "6: sacf 0\n" |
148 | EX_TABLE(1b,6b) EX_TABLE(2b,0b) EX_TABLE(4b,0b) | 147 | EX_TABLE(1b,6b) EX_TABLE(2b,0b) EX_TABLE(4b,0b) |
149 | : "+a" (size), "+a" (to), "+a" (from), "=a" (tmp1) | 148 | : "+a" (size), "+a" (to), "+a" (from), "=a" (tmp1) |
150 | : : "cc", "memory"); | 149 | : : "cc", "memory"); |
@@ -156,9 +155,9 @@ static size_t clear_user_std(size_t size, void __user *to) | |||
156 | unsigned long tmp1, tmp2; | 155 | unsigned long tmp1, tmp2; |
157 | 156 | ||
158 | asm volatile( | 157 | asm volatile( |
158 | " sacf 256\n" | ||
159 | " "AHI" %0,-1\n" | 159 | " "AHI" %0,-1\n" |
160 | " jo 5f\n" | 160 | " jo 5f\n" |
161 | " sacf 256\n" | ||
162 | " bras %3,3f\n" | 161 | " bras %3,3f\n" |
163 | " xc 0(1,%1),0(%1)\n" | 162 | " xc 0(1,%1),0(%1)\n" |
164 | "0:"AHI" %0,257\n" | 163 | "0:"AHI" %0,257\n" |
@@ -178,9 +177,8 @@ static size_t clear_user_std(size_t size, void __user *to) | |||
178 | "3:"AHI" %0,-256\n" | 177 | "3:"AHI" %0,-256\n" |
179 | " jnm 2b\n" | 178 | " jnm 2b\n" |
180 | "4: ex %0,0(%3)\n" | 179 | "4: ex %0,0(%3)\n" |
181 | " sacf 0\n" | ||
182 | "5: "SLR" %0,%0\n" | 180 | "5: "SLR" %0,%0\n" |
183 | "6:\n" | 181 | "6: sacf 0\n" |
184 | EX_TABLE(1b,6b) EX_TABLE(2b,0b) EX_TABLE(4b,0b) | 182 | EX_TABLE(1b,6b) EX_TABLE(2b,0b) EX_TABLE(4b,0b) |
185 | : "+a" (size), "+a" (to), "=a" (tmp1), "=a" (tmp2) | 183 | : "+a" (size), "+a" (to), "=a" (tmp1), "=a" (tmp2) |
186 | : : "cc", "memory"); | 184 | : : "cc", "memory"); |