linux/arch/parisc/lib
Helge Deller d19f5e41b3 parisc: Clean up fixup routines for get_user()/put_user()
Al Viro noticed that userspace accesses via get_user()/put_user() can be
simplified a lot with regard to usage of the exception handling.

This patch implements a fixup routine for get_user() and put_user() in such
that the exception handler will automatically load -EFAULT into the register
%r8 (the error value) in case on a fault on userspace.  Additionally the fixup
routine will zero the target register on fault in case of a get_user() call.
The target register is extracted out of the faulting assembly instruction.

This patch brings a few benefits over the old implementation:
1. Exception handling gets much cleaner, easier and smaller in size.
2. Helper functions like fixup_get_user_skip_1 (all of fixup.S) can be dropped.
3. No need to hardcode %r9 as target register for get_user() any longer. This
   helps the compiler register allocator and thus creates less assembler
   statements.
4. No dependency on the exception_data contents any longer.
5. Nested faults will be handled cleanly.

Reported-by: Al Viro <viro@ZenIV.linux.org.uk>
Cc: <stable@vger.kernel.org> # v4.9+
Signed-off-by: Helge Deller <deller@gmx.de>
2017-03-29 21:50:36 +02:00
..
bitops.c parisc: Add native high-resolution sched_clock() implementation 2016-05-22 21:39:25 +02:00
checksum.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
delay.c parisc: make udelay() SMP-safe 2013-11-07 22:28:26 +01:00
io.c
iomap.c parisc: Change structure intialisation to C99 style in iomap.c 2016-08-02 16:44:34 +02:00
lusercopy.S parisc: Fix access fault handling in pa_memcpy() 2017-03-29 21:49:02 +02:00
Makefile parisc: Clean up fixup routines for get_user()/put_user() 2017-03-29 21:50:36 +02:00
memcpy.c parisc: Fix access fault handling in pa_memcpy() 2017-03-29 21:49:02 +02:00
memset.c
ucmpdi2.c parisc: Provide __ucmpdi2 to resolve undefined references in 32 bit builds. 2013-04-25 22:36:15 +02:00