Lines Matching full:fault
6 * Derived from "arch/i386/mm/fault.c"
106 * 5. T1 : enters fault handler, takes mmap_lock, etc... in bad_access_pkey()
133 vm_fault_t fault) in do_sigbus() argument
140 if (fault & (VM_FAULT_HWPOISON|VM_FAULT_HWPOISON_LARGE)) { in do_sigbus()
143 pr_err("MCE: Killing %s:%d due to hardware memory corruption fault at %lx\n", in do_sigbus()
146 if (fault & VM_FAULT_HWPOISON_LARGE) in do_sigbus()
147 lsb = hstate_index_to_shift(VM_FAULT_GET_HINDEX(fault)); in do_sigbus()
148 if (fault & VM_FAULT_HWPOISON) in do_sigbus()
161 vm_fault_t fault) in mm_fault_error() argument
164 * Kernel page fault interrupted by SIGKILL. We have no reason to in mm_fault_error()
171 if (fault & VM_FAULT_OOM) { in mm_fault_error()
174 * made us unable to handle the page fault gracefully. in mm_fault_error()
180 if (fault & (VM_FAULT_SIGBUS|VM_FAULT_HWPOISON| in mm_fault_error()
182 return do_sigbus(regs, addr, fault); in mm_fault_error()
183 else if (fault & VM_FAULT_SIGSEGV) in mm_fault_error()
191 /* Is this a bad kernel fault ? */
203 // Kernel exec fault is always bad in bad_kernel_fault()
207 // Kernel fault on kernel address is bad in bad_kernel_fault()
211 // Read/write fault blocked by KUAP is bad, it can never succeed. in bad_kernel_fault()
217 // Fault on user outside of certain regions (eg. copy_tofrom_user()) is bad in bad_kernel_fault()
221 // Read/write fault in a valid region (the exception table search passed in bad_kernel_fault()
223 return WARN(true, "Bug: %s fault blocked by KUAP!", is_write ? "Write" : "Read"); in bad_kernel_fault()
226 // What's left? Kernel fault on user and allowed by KUAP in the faulting context. in bad_kernel_fault()
235 * faults just to hit a pkey fault as soon as we fill in a in access_pkey_error()
281 * fault path, handle_mm_fault() also does the same check. To avoid in access_error()
328 * fault instead of DSISR_PROTFAULT. in sanity_check_fault()
337 * sync between D/I cache via fault. But that is handled via low level in sanity_check_fault()
338 * hash fault code (hash_page_do_lazy_icache()) and we should not reach in sanity_check_fault()
347 * set_pte_at while taking the noexec/prot fault. Hence this is WARN_ON in sanity_check_fault()
350 * For radix, we can get prot fault for autonuma case, because radix in sanity_check_fault()
396 * for a data fault, SRR1 for an instruction fault.
397 * For 400-family processors the error_code parameter is ESR for a data fault,
398 * 0 for an instruction fault.
400 * fault, SRR1 & 0x08000000 for an instruction access fault.
402 * The return value is 0 if the fault was handled, or the signal
403 * number if this is a kernel fault that can't be handled here.
414 vm_fault_t fault, major = 0; in ___do_page_fault() local
432 * The kernel should never take an execute fault nor should it in ___do_page_fault()
433 * take a page fault to a kernel address or a page fault to a user in ___do_page_fault()
437 * the NIP belongs to the fixup table for cases where fault could come in ___do_page_fault()
451 * in a region with pagefaults disabled then we must not take the fault in ___do_page_fault()
455 printk_ratelimited(KERN_ERR "Page fault in user mode" in ___do_page_fault()
468 * can result in fault, which will cause a deadlock when called with in ___do_page_fault()
496 fault = handle_mm_fault(vma, address, flags | FAULT_FLAG_VMA_LOCK, regs); in ___do_page_fault()
497 if (!(fault & (VM_FAULT_RETRY | VM_FAULT_COMPLETED))) in ___do_page_fault()
500 if (!(fault & VM_FAULT_RETRY)) { in ___do_page_fault()
506 if (fault_signal_pending(fault, regs)) in ___do_page_fault()
514 * erroneous fault occurring in a code path which already holds mmap_lock in ___do_page_fault()
515 * we will deadlock attempting to validate the fault against the in ___do_page_fault()
533 * If for any reason at all we couldn't handle the fault, in ___do_page_fault()
535 * the fault. in ___do_page_fault()
537 fault = handle_mm_fault(vma, address, flags, regs); in ___do_page_fault()
539 major |= fault & VM_FAULT_MAJOR; in ___do_page_fault()
541 if (fault_signal_pending(fault, regs)) in ___do_page_fault()
544 /* The fault is fully completed (including releasing mmap lock) */ in ___do_page_fault()
545 if (fault & VM_FAULT_COMPLETED) in ___do_page_fault()
552 if (unlikely(fault & VM_FAULT_RETRY)) { in ___do_page_fault()
560 if (unlikely(fault & VM_FAULT_ERROR)) in ___do_page_fault()
561 return mm_fault_error(regs, address, fault); in ___do_page_fault()
565 * Major/minor page fault accounting. in ___do_page_fault()
633 pr_alert("BUG: Unable to handle unknown paging fault at 0x%08lx\n", in __bad_page_fault()
650 /* Are we prepared to handle this fault? */ in bad_page_fault()