Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 320429
b: refs/heads/master
c: 008c2e8
h: refs/heads/master
i:
  320427: a8596d8
v: v3
  • Loading branch information
Heiko Carstens authored and Martin Schwidefsky committed Jul 30, 2012
1 parent 2be6a34 commit faf04c2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f2c76e3b6f72c3fda290998109594dc490b8b087
refs/heads/master: 008c2e8f247f0a8db1e8e26139da12f3a3abcda0
13 changes: 7 additions & 6 deletions trunk/arch/s390/mm/fault.c
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,7 @@ int __handle_fault(unsigned long uaddr, unsigned long pgm_int_code, int write)
struct pt_regs regs;
int access, fault;

/* Emulate a uaccess fault from kernel mode. */
regs.psw.mask = psw_kernel_bits | PSW_MASK_DAT | PSW_MASK_MCHECK;
if (!irqs_disabled())
regs.psw.mask |= PSW_MASK_IO | PSW_MASK_EXT;
Expand All @@ -460,12 +461,12 @@ int __handle_fault(unsigned long uaddr, unsigned long pgm_int_code, int write)
regs.int_parm_long = (uaddr & PAGE_MASK) | 2;
access = write ? VM_WRITE : VM_READ;
fault = do_exception(&regs, access);
if (unlikely(fault)) {
if (fault & VM_FAULT_OOM)
return -EFAULT;
else if (fault & VM_FAULT_SIGBUS)
do_sigbus(&regs);
}
/*
* Since the fault happened in kernel mode while performing a uaccess
* all we need to do now is emulating a fixup in case "fault" is not
* zero.
* For the calling uaccess functions this results always in -EFAULT.
*/
return fault ? -EFAULT : 0;
}

Expand Down

0 comments on commit faf04c2

Please sign in to comment.