aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/mm
diff options
context:
space:
mode:
authorGerald Schaefer <gerald.schaefer@de.ibm.com>2009-12-07 06:51:47 -0500
committerMartin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com>2009-12-07 06:51:34 -0500
commit6c1e3e79430615d0472dbf9f8fed89c571e66423 (patch)
treeed7b6fde69c9b74cd6be35f82a7a75cc2fc77775 /arch/s390/mm
parent1ab947de293f43812276b60cf9fa21127e7a5bb2 (diff)
[S390] Use do_exception() in pagetable walk usercopy functions.
The pagetable walk usercopy functions have used a modified copy of the do_exception() function for fault handling. This lead to inconsistencies with recent changes to do_exception(), e.g. performance counters. This patch changes the pagetable walk usercopy code to call do_exception() directly, eliminating the redundancy. A new parameter is added to do_exception() to specify the fault address. Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/mm')
-rw-r--r--arch/s390/mm/fault.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c
index 5a9e9a77dc16..fc102e70d9c2 100644
--- a/arch/s390/mm/fault.c
+++ b/arch/s390/mm/fault.c
@@ -442,6 +442,29 @@ no_context:
442} 442}
443#endif 443#endif
444 444
445int __handle_fault(unsigned long uaddr, unsigned long int_code, int write_user)
446{
447 struct pt_regs regs;
448 int access, fault;
449
450 regs.psw.mask = psw_kernel_bits;
451 if (!irqs_disabled())
452 regs.psw.mask |= PSW_MASK_IO | PSW_MASK_EXT;
453 regs.psw.addr = (unsigned long) __builtin_return_address(0);
454 regs.psw.addr |= PSW_ADDR_AMODE;
455 uaddr &= PAGE_MASK;
456 access = write_user ? VM_WRITE : VM_READ;
457 fault = do_exception(&regs, access, uaddr | 2);
458 if (unlikely(fault)) {
459 if (fault & VM_FAULT_OOM) {
460 pagefault_out_of_memory();
461 fault = 0;
462 } else if (fault & VM_FAULT_SIGBUS)
463 do_sigbus(&regs, int_code, uaddr);
464 }
465 return fault ? -EFAULT : 0;
466}
467
445#ifdef CONFIG_PFAULT 468#ifdef CONFIG_PFAULT
446/* 469/*
447 * 'pfault' pseudo page faults routines. 470 * 'pfault' pseudo page faults routines.