diff options
author | Heiko Carstens <hca@linux.ibm.com> | 2023-10-12 10:40:47 +0300 |
---|---|---|
committer | Vasily Gorbik <gor@linux.ibm.com> | 2023-10-23 19:21:22 +0300 |
commit | 64ea33fb09f8fdcc9eb9f253906886a5801bb48a (patch) | |
tree | 870d10a4b87ace2283cc30aefabf9a659a14eaf7 /arch/s390 | |
parent | 5db06565cad67442e4677e7c0da7f7dad1eccb03 (diff) | |
download | linux-64ea33fb09f8fdcc9eb9f253906886a5801bb48a.tar.xz |
s390/mm,fault: call do_fault_error() only from do_exception()
Remove duplicated fault error handling and handle it only once within
do_exception().
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r-- | arch/s390/mm/fault.c | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c index 87bfcf4d3082..9ed979690665 100644 --- a/arch/s390/mm/fault.c +++ b/arch/s390/mm/fault.c @@ -321,7 +321,7 @@ static void do_fault_error(struct pt_regs *regs, vm_fault_t fault) * 11 Page translation -> Not present (nullification) * 3b Region third trans. -> Not present (nullification) */ -static inline vm_fault_t do_exception(struct pt_regs *regs, int access) +static void do_exception(struct pt_regs *regs, int access) { struct vm_area_struct *vma; struct task_struct *tsk; @@ -340,7 +340,7 @@ static inline vm_fault_t do_exception(struct pt_regs *regs, int access) */ clear_thread_flag(TIF_PER_TRAP); if (kprobe_page_fault(regs, 14)) - return 0; + return; mm = tsk->mm; address = get_fault_address(regs); is_write = fault_is_write(regs); @@ -468,14 +468,13 @@ out_gmap: out_up: mmap_read_unlock(mm); out: - return fault; + if (unlikely(fault)) + do_fault_error(regs, fault); } void do_protection_exception(struct pt_regs *regs) { union teid teid = { .val = regs->int_parm_long }; - vm_fault_t fault; - int access; /* * Protection exceptions are suppressing, decrement psw address. @@ -502,26 +501,16 @@ void do_protection_exception(struct pt_regs *regs) } if (unlikely(MACHINE_HAS_NX && teid.b56)) { regs->int_parm_long = (teid.addr * PAGE_SIZE) | (regs->psw.addr & PAGE_MASK); - access = VM_EXEC; - fault = VM_FAULT_BADACCESS; - } else { - access = VM_WRITE; - fault = do_exception(regs, access); + do_fault_error(regs, VM_FAULT_BADACCESS); + return; } - if (unlikely(fault)) - do_fault_error(regs, fault); + do_exception(regs, VM_WRITE); } NOKPROBE_SYMBOL(do_protection_exception); void do_dat_exception(struct pt_regs *regs) { - vm_fault_t fault; - int access; - - access = VM_ACCESS_FLAGS; - fault = do_exception(regs, access); - if (unlikely(fault)) - do_fault_error(regs, fault); + do_exception(regs, VM_ACCESS_FLAGS); } NOKPROBE_SYMBOL(do_dat_exception); |