Lines Matching +full:address +full:- +full:translation

1 // SPDX-License-Identifier: GPL-2.0-only
6 * Copyright (C) 1995-2004 Russell King
21 #include <linux/page-flags.h>
37 #include <asm/debug-monitors.h>
116 esr_to_fault_info(esr)->name); in mem_abort_decode()
126 return __pa_symbol(mm->pgd); in mm_to_pgd_phys()
128 return (unsigned long)virt_to_phys(mm->pgd); in mm_to_pgd_phys()
142 mm = current->active_mm; in show_pte()
144 pr_alert("[%016lx] user address but active_mm is swapper\n", in show_pte()
152 pr_alert("[%016lx] address between user and kernel address ranges\n", in show_pte()
157 pr_alert("%s pgtable: %luk pages, %llu-bit VAs, pgdp=%016lx\n", in show_pte()
209 * like __set_ptes(), the PTE is never changed from no-exec to exec here.
214 unsigned long address, pte_t *ptep, in __ptep_set_access_flags() argument
242 /* Invalidate a stale read-only entry */ in __ptep_set_access_flags()
244 flush_tlb_page(vma, address); in __ptep_set_access_flags()
269 (regs->pstate & PSR_PAN_BIT); in is_el1_permission_fault()
291 * If we now have a valid translation, treat the translation fault as in is_spurious_el1_translation_fault()
299 * treat the translation fault as spurious. in is_spurious_el1_translation_fault()
310 pr_alert("Unable to handle kernel %s at virtual address %016lx\n", msg, in die_kernel_fault()
332 kasan_report((void *)addr, 0, is_write, regs->pc); in report_tag_fault()
382 "Ignoring spurious kernel translation fault at virtual address %016lx\n", addr)) in __do_kernel_fault()
393 msg = "write to read-only memory"; in __do_kernel_fault()
395 msg = "execute from non-executable memory"; in __do_kernel_fault()
414 static void set_thread_esr(unsigned long address, unsigned long esr) in set_thread_esr() argument
416 current->thread.fault_address = address; in set_thread_esr()
419 * If the faulting address is in the kernel, we must sanitize the ESR. in set_thread_esr()
420 * From userspace's point of view, kernel-only mappings don't exist in set_thread_esr()
421 * at all, so we report them as level 0 translation faults. in set_thread_esr()
424 * precedence over translation fault for a real access to empty in set_thread_esr()
427 * type", so we ignore this wrinkle and just return the translation in set_thread_esr()
430 if (!is_ttbr0_addr(current->thread.fault_address)) { in set_thread_esr()
448 * Claim a level 0 translation fault. in set_thread_esr()
468 current->thread.fault_code = esr; in set_thread_esr()
484 arm64_force_sig_fault(inf->sig, inf->code, far, inf->name); in do_bad_area()
536 if (!(vma->vm_flags & VM_SHADOW_STACK)) in is_invalid_gcs_access()
538 } else if (unlikely(vma->vm_flags & VM_SHADOW_STACK)) { in is_invalid_gcs_access()
550 struct mm_struct *mm = current->mm; in do_page_fault()
557 int pkey = -1; in do_page_fault()
573 * vm_flags tells us what bits we must have in vma->vm_flags in do_page_fault()
575 * vma->vm_flags & vm_flags and returns an error if the in do_page_fault()
609 if (!search_exception_tables(regs->pc)) in do_page_fault()
630 if (!(vma->vm_flags & vm_flags)) { in do_page_fault()
675 if (!(vma->vm_flags & vm_flags)) { in do_page_fault()
727 * oom-killed). in do_page_fault()
740 arm64_force_sig_fault(SIGBUS, BUS_ADRERR, far, inf->name); in do_page_fault()
748 arm64_force_sig_mceerr(BUS_MCEERR_AR, far, lsb, inf->name); in do_page_fault()
764 arm64_force_sig_fault_pkey(far, inf->name, pkey); in do_page_fault()
766 arm64_force_sig_fault(SIGSEGV, si_code, far, inf->name); in do_page_fault()
813 * APEI claimed this as a firmware-first notification. in do_sea()
829 arm64_notify_die(inf->name, regs, inf->sig, inf->code, siaddr, esr); in do_sea()
840 * address. in do_tag_check_fault()
848 { do_bad, SIGKILL, SI_KERNEL, "ttbr address size fault" },
849 { do_bad, SIGKILL, SI_KERNEL, "level 1 address size fault" },
850 { do_bad, SIGKILL, SI_KERNEL, "level 2 address size fault" },
851 { do_bad, SIGKILL, SI_KERNEL, "level 3 address size fault" },
852 { do_translation_fault, SIGSEGV, SEGV_MAPERR, "level 0 translation fault" },
853 { do_translation_fault, SIGSEGV, SEGV_MAPERR, "level 1 translation fault" },
854 { do_translation_fault, SIGSEGV, SEGV_MAPERR, "level 2 translation fault" },
855 { do_translation_fault, SIGSEGV, SEGV_MAPERR, "level 3 translation fault" },
867 { do_sea, SIGKILL, SI_KERNEL, "level -1 (translation table walk)" },
868 { do_sea, SIGKILL, SI_KERNEL, "level 0 (translation table walk)" },
869 { do_sea, SIGKILL, SI_KERNEL, "level 1 (translation table walk)" },
870 { do_sea, SIGKILL, SI_KERNEL, "level 2 (translation table walk)" },
871 { do_sea, SIGKILL, SI_KERNEL, "level 3 (translation table walk)" },
875 …{ do_sea, SIGKILL, SI_KERNEL, "level -1 synchronous parity error (translation table walk)" }, // …
876 …{ do_sea, SIGKILL, SI_KERNEL, "level 0 synchronous parity error (translation table walk)" }, // R…
877 …{ do_sea, SIGKILL, SI_KERNEL, "level 1 synchronous parity error (translation table walk)" }, // R…
878 …{ do_sea, SIGKILL, SI_KERNEL, "level 2 synchronous parity error (translation table walk)" }, // R…
879 …{ do_sea, SIGKILL, SI_KERNEL, "level 3 synchronous parity error (translation table walk)" }, // R…
889 { do_bad, SIGKILL, SI_KERNEL, "level -1 address size fault" },
891 { do_translation_fault, SIGSEGV, SEGV_MAPERR, "level -1 translation fault" },
919 if (!inf->fn(far, esr, regs)) in do_mem_abort()
923 die_kernel_fault(inf->name, addr, esr, regs); in do_mem_abort()
928 * address to the signal handler. in do_mem_abort()
930 arm64_notify_die(inf->name, regs, inf->sig, inf->code, addr, esr); in do_mem_abort()
944 * See traps.c and debug-monitors.c:debug_traps_init().
948 { do_bad, SIGTRAP, TRAP_HWBKPT, "hardware single-step" },
1002 if (inf->fn(addr_if_watchpoint, esr, regs)) { in do_debug_exception()
1003 arm64_notify_die(inf->name, regs, inf->sig, inf->code, pc, esr); in do_debug_exception()
1023 if (vma->vm_flags & VM_MTE) in vma_alloc_zeroed_movable_folio()