aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-parisc
diff options
context:
space:
mode:
authorCarlos O'Donell <carlos@parisc-linux.org>2006-04-22 16:47:21 -0400
committerKyle McMartin <kyle@hera.kernel.org>2006-06-27 19:28:33 -0400
commit3fd3a74f45c935f7d6d5c2fb48f06324b18826b7 (patch)
tree552033cbdc4e19b667a25c55e642a172a1ec3b2e /include/asm-parisc
parentc8224e0074f1dce12e95e53ca469f6fe49cc9101 (diff)
[PARISC] Use FIXUP_BRANCH_CLOBBER to asm clobber list
Joel Soete noticed correctly that the fixup's clobbers must be listed as the ASM clobbers. FIXUP_BRANCH in unaligned.c has a new macro which lists all the clobbers in the fixup, we use this throughout the file to simplify the process of listing clobbers in the future. A missing "r1" clobber is added to our uaccess.h for the 64-bit __put_kernel_asm. Interestingly this is a pretty serious bug since gcc generates pretty good use of r1 as a temporary and the uses of __put_kernel_asm are varied and dangerous if r1 is scratched during an invalid write. Signed-off-by: Joel Soete <soete.joel@tiscali.be> Signed-off-by: Carlos O'Donell <carlos@parisc-linux.org> Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
Diffstat (limited to 'include/asm-parisc')
-rw-r--r--include/asm-parisc/uaccess.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/asm-parisc/uaccess.h b/include/asm-parisc/uaccess.h
index f6c417c8c484..d973e8b3466c 100644
--- a/include/asm-parisc/uaccess.h
+++ b/include/asm-parisc/uaccess.h
@@ -172,7 +172,11 @@ struct exception_data {
172/* 172/*
173 * The "__put_user/kernel_asm()" macros tell gcc they read from memory 173 * The "__put_user/kernel_asm()" macros tell gcc they read from memory
174 * instead of writing. This is because they do not write to any memory 174 * instead of writing. This is because they do not write to any memory
175 * gcc knows about, so there are no aliasing issues. 175 * gcc knows about, so there are no aliasing issues. These macros must
176 * also be aware that "fixup_put_user_skip_[12]" are executed in the
177 * context of the fault, and any registers used there must be listed
178 * as clobbers. In this case only "r1" is used by the current routines.
179 * r8/r9 are already listed as err/val.
176 */ 180 */
177 181
178#ifdef __LP64__ 182#ifdef __LP64__
@@ -183,7 +187,8 @@ struct exception_data {
183 "\t.dword\t1b,fixup_put_user_skip_1\n" \ 187 "\t.dword\t1b,fixup_put_user_skip_1\n" \
184 "\t.previous" \ 188 "\t.previous" \
185 : "=r"(__pu_err) \ 189 : "=r"(__pu_err) \
186 : "r"(ptr), "r"(x), "0"(__pu_err)) 190 : "r"(ptr), "r"(x), "0"(__pu_err) \
191 : "r1")
187 192
188#define __put_user_asm(stx,x,ptr) \ 193#define __put_user_asm(stx,x,ptr) \
189 __asm__ __volatile__ ( \ 194 __asm__ __volatile__ ( \