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>
110 esr_to_fault_info(esr)->name); in mem_abort_decode()
120 return __pa_symbol(mm->pgd); in mm_to_pgd_phys()
122 return (unsigned long)virt_to_phys(mm->pgd); in mm_to_pgd_phys()
136 mm = current->active_mm; in show_pte()
138 pr_alert("[%016lx] user address but active_mm is swapper\n", in show_pte()
146 pr_alert("[%016lx] address between user and kernel address ranges\n", in show_pte()
151 pr_alert("%s pgtable: %luk pages, %llu-bit VAs, pgdp=%016lx\n", in show_pte()
203 * like __set_ptes(), the PTE is never changed from no-exec to exec here.
208 unsigned long address, pte_t *ptep, in __ptep_set_access_flags() argument
237 * Invalidate the local stale read-only entry. Remote stale entries in __ptep_set_access_flags()
242 local_flush_tlb_page(vma, address); in __ptep_set_access_flags()
267 (regs->pstate & PSR_PAN_BIT); in is_el1_permission_fault()
289 * If we now have a valid translation, treat the translation fault as in is_spurious_el1_translation_fault()
297 * treat the translation fault as spurious. in is_spurious_el1_translation_fault()
308 pr_alert("Unable to handle kernel %s at virtual address %016lx\n", msg, in die_kernel_fault()
330 kasan_report((void *)addr, 0, is_write, regs->pc); in report_tag_fault()
380 "Ignoring spurious kernel translation fault at virtual address %016lx\n", addr)) in __do_kernel_fault()
391 msg = "write to read-only memory"; in __do_kernel_fault()
393 msg = "execute from non-executable memory"; in __do_kernel_fault()
412 static void set_thread_esr(unsigned long address, unsigned long esr) in set_thread_esr() argument
414 current->thread.fault_address = address; in set_thread_esr()
417 * If the faulting address is in the kernel, we must sanitize the ESR. in set_thread_esr()
418 * From userspace's point of view, kernel-only mappings don't exist in set_thread_esr()
419 * at all, so we report them as level 0 translation faults. in set_thread_esr()
422 * precedence over translation fault for a real access to empty in set_thread_esr()
425 * type", so we ignore this wrinkle and just return the translation in set_thread_esr()
428 if (!is_ttbr0_addr(current->thread.fault_address)) { in set_thread_esr()
446 * Claim a level 0 translation fault. in set_thread_esr()
466 current->thread.fault_code = esr; in set_thread_esr()
482 arm64_force_sig_fault(inf->sig, inf->code, far, inf->name); in do_bad_area()
497 * - If Overlay is set, a fault did occur due to POE, but it may be in fault_from_pkey()
499 * on context-switch). We would then need to manually check POR_EL0 in fault_from_pkey()
503 * - If Overlay is not set, we may still need to report a pkey fault. in fault_from_pkey()
508 * to report the correct error code - SEGV_PKUERR - we must handle in fault_from_pkey()
546 if (!(vma->vm_flags & VM_SHADOW_STACK)) in is_invalid_gcs_access()
548 } else if (unlikely(vma->vm_flags & VM_SHADOW_STACK)) { in is_invalid_gcs_access()
560 struct mm_struct *mm = current->mm; in do_page_fault()
567 int pkey = -1; in do_page_fault()
583 * vm_flags tells us what bits we must have in vma->vm_flags in do_page_fault()
585 * vma->vm_flags & vm_flags and returns an error if the in do_page_fault()
619 if (!insn_may_access_user(regs->pc, esr)) in do_page_fault()
640 if (!(vma->vm_flags & vm_flags)) { in do_page_fault()
685 if (!(vma->vm_flags & vm_flags)) { in do_page_fault()
737 * oom-killed). in do_page_fault()
750 arm64_force_sig_fault(SIGBUS, BUS_ADRERR, far, inf->name); in do_page_fault()
758 arm64_force_sig_mceerr(BUS_MCEERR_AR, far, lsb, inf->name); in do_page_fault()
774 arm64_force_sig_fault_pkey(far, inf->name, pkey); in do_page_fault()
776 arm64_force_sig_fault(SIGSEGV, si_code, far, inf->name); in do_page_fault()
823 * APEI claimed this as a firmware-first notification. in do_sea()
840 arm64_notify_die(inf->name, regs, inf->sig, inf->code, siaddr, esr); in do_sea()
851 * address if ARM64_MTE_FAR isn't supported. in do_tag_check_fault()
862 { do_bad, SIGKILL, SI_KERNEL, "ttbr address size fault" },
863 { do_bad, SIGKILL, SI_KERNEL, "level 1 address size fault" },
864 { do_bad, SIGKILL, SI_KERNEL, "level 2 address size fault" },
865 { do_bad, SIGKILL, SI_KERNEL, "level 3 address size fault" },
866 { do_translation_fault, SIGSEGV, SEGV_MAPERR, "level 0 translation fault" },
867 { do_translation_fault, SIGSEGV, SEGV_MAPERR, "level 1 translation fault" },
868 { do_translation_fault, SIGSEGV, SEGV_MAPERR, "level 2 translation fault" },
869 { do_translation_fault, SIGSEGV, SEGV_MAPERR, "level 3 translation fault" },
881 { do_sea, SIGKILL, SI_KERNEL, "level -1 (translation table walk)" },
882 { do_sea, SIGKILL, SI_KERNEL, "level 0 (translation table walk)" },
883 { do_sea, SIGKILL, SI_KERNEL, "level 1 (translation table walk)" },
884 { do_sea, SIGKILL, SI_KERNEL, "level 2 (translation table walk)" },
885 { do_sea, SIGKILL, SI_KERNEL, "level 3 (translation table walk)" },
889 …{ do_sea, SIGKILL, SI_KERNEL, "level -1 synchronous parity error (translation table walk)" }, // …
890 …{ do_sea, SIGKILL, SI_KERNEL, "level 0 synchronous parity error (translation table walk)" }, // R…
891 …{ do_sea, SIGKILL, SI_KERNEL, "level 1 synchronous parity error (translation table walk)" }, // R…
892 …{ do_sea, SIGKILL, SI_KERNEL, "level 2 synchronous parity error (translation table walk)" }, // R…
893 …{ do_sea, SIGKILL, SI_KERNEL, "level 3 synchronous parity error (translation table walk)" }, // R…
903 { do_bad, SIGKILL, SI_KERNEL, "level -1 address size fault" },
905 { do_translation_fault, SIGSEGV, SEGV_MAPERR, "level -1 translation fault" },
933 if (!inf->fn(far, esr, regs)) in do_mem_abort()
937 die_kernel_fault(inf->name, addr, esr, regs); in do_mem_abort()
942 * address to the signal handler. in do_mem_abort()
944 arm64_notify_die(inf->name, regs, inf->sig, inf->code, addr, esr); in do_mem_abort()
968 if (vma->vm_flags & VM_MTE) in vma_alloc_zeroed_movable_folio()