linux/arch/parisc/mm
Helge Deller 09b931fcb8 parisc: Clean up fixup routines for get_user()/put_user()
commit d19f5e41b3 upstream.

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>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2017-04-08 09:30:34 +02:00
..
fault.c parisc: Clean up fixup routines for get_user()/put_user() 2017-04-08 09:30:34 +02:00
hugetlbpage.c mm: cleanup *pte_alloc* interfaces 2016-03-17 15:09:34 -07:00
init.c parisc: Zero-initialize newly alloced memblock 2016-10-11 20:52:12 +02:00
ioremap.c parisc: fix wrong page aligned size calculation in ioremapping code 2010-08-12 08:43:29 -07:00
Makefile parisc: Add Huge Page and HUGETLBFS support 2015-11-22 12:23:10 +01:00