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>
36 #include <asm/debug-monitors.h>
115 esr_to_fault_info(esr)->name); in mem_abort_decode()
125 return __pa_symbol(mm->pgd); in mm_to_pgd_phys()
127 return (unsigned long)virt_to_phys(mm->pgd); in mm_to_pgd_phys()
141 mm = current->active_mm; in show_pte()
143 pr_alert("[%016lx] user address but active_mm is swapper\n", in show_pte()
151 pr_alert("[%016lx] address between user and kernel address ranges\n", in show_pte()
156 pr_alert("%s pgtable: %luk pages, %llu-bit VAs, pgdp=%016lx\n", in show_pte()
208 * like set_pte_at(), the PTE is never changed from no-exec to exec here.
213 unsigned long address, pte_t *ptep, in ptep_set_access_flags() argument
241 /* Invalidate a stale read-only entry */ in ptep_set_access_flags()
243 flush_tlb_page(vma, address); in ptep_set_access_flags()
270 (regs->pstate & PSR_PAN_BIT); in is_el1_permission_fault()
293 * If we now have a valid translation, treat the translation fault as in is_spurious_el1_translation_fault()
301 * treat the translation fault as spurious. in is_spurious_el1_translation_fault()
312 pr_alert("Unable to handle kernel %s at virtual address %016lx\n", msg, in die_kernel_fault()
334 kasan_report((void *)addr, 0, is_write, regs->pc); in report_tag_fault()
389 "Ignoring spurious kernel translation fault at virtual address %016lx\n", addr)) in __do_kernel_fault()
400 msg = "write to read-only memory"; in __do_kernel_fault()
402 msg = "execute from non-executable memory"; in __do_kernel_fault()
421 static void set_thread_esr(unsigned long address, unsigned long esr) in set_thread_esr() argument
423 current->thread.fault_address = address; in set_thread_esr()
426 * If the faulting address is in the kernel, we must sanitize the ESR. in set_thread_esr()
427 * From userspace's point of view, kernel-only mappings don't exist in set_thread_esr()
428 * at all, so we report them as level 0 translation faults. in set_thread_esr()
431 * precedence over translation fault for a real access to empty in set_thread_esr()
434 * type", so we ignore this wrinkle and just return the translation in set_thread_esr()
437 if (!is_ttbr0_addr(current->thread.fault_address)) { in set_thread_esr()
455 * Claim a level 0 translation fault. in set_thread_esr()
475 current->thread.fault_code = esr; in set_thread_esr()
491 arm64_force_sig_fault(inf->sig, inf->code, far, inf->name); in do_bad_area()
511 if (!(vma->vm_flags & vm_flags)) in __do_page_fault()
534 struct mm_struct *mm = current->mm; in do_page_fault()
555 * vm_flags tells us what bits we must have in vma->vm_flags in do_page_fault()
557 * vma->vm_flags & vm_flags and returns an error if the in do_page_fault()
583 if (!search_exception_tables(regs->pc)) in do_page_fault()
597 if (!(vma->vm_flags & vm_flags)) { in do_page_fault()
664 * oom-killed). in do_page_fault()
677 arm64_force_sig_fault(SIGBUS, BUS_ADRERR, far, inf->name); in do_page_fault()
685 arm64_force_sig_mceerr(BUS_MCEERR_AR, far, lsb, inf->name); in do_page_fault()
693 far, inf->name); in do_page_fault()
740 * APEI claimed this as a firmware-first notification. in do_sea()
756 arm64_notify_die(inf->name, regs, inf->sig, inf->code, siaddr, esr); in do_sea()
767 * address. in do_tag_check_fault()
775 { do_bad, SIGKILL, SI_KERNEL, "ttbr address size fault" },
776 { do_bad, SIGKILL, SI_KERNEL, "level 1 address size fault" },
777 { do_bad, SIGKILL, SI_KERNEL, "level 2 address size fault" },
778 { do_bad, SIGKILL, SI_KERNEL, "level 3 address size fault" },
779 { do_translation_fault, SIGSEGV, SEGV_MAPERR, "level 0 translation fault" },
780 { do_translation_fault, SIGSEGV, SEGV_MAPERR, "level 1 translation fault" },
781 { do_translation_fault, SIGSEGV, SEGV_MAPERR, "level 2 translation fault" },
782 { do_translation_fault, SIGSEGV, SEGV_MAPERR, "level 3 translation fault" },
795 { do_sea, SIGKILL, SI_KERNEL, "level 0 (translation table walk)" },
796 { do_sea, SIGKILL, SI_KERNEL, "level 1 (translation table walk)" },
797 { do_sea, SIGKILL, SI_KERNEL, "level 2 (translation table walk)" },
798 { do_sea, SIGKILL, SI_KERNEL, "level 3 (translation table walk)" },
803 …{ do_sea, SIGKILL, SI_KERNEL, "level 0 synchronous parity error (translation table walk)" }, // R…
804 …{ do_sea, SIGKILL, SI_KERNEL, "level 1 synchronous parity error (translation table walk)" }, // R…
805 …{ do_sea, SIGKILL, SI_KERNEL, "level 2 synchronous parity error (translation table walk)" }, // R…
806 …{ do_sea, SIGKILL, SI_KERNEL, "level 3 synchronous parity error (translation table walk)" }, // R…
846 if (!inf->fn(far, esr, regs)) in do_mem_abort()
850 die_kernel_fault(inf->name, addr, esr, regs); in do_mem_abort()
855 * address to the signal handler. in do_mem_abort()
857 arm64_notify_die(inf->name, regs, inf->sig, inf->code, addr, esr); in do_mem_abort()
871 * See traps.c and debug-monitors.c:debug_traps_init().
875 { do_bad, SIGTRAP, TRAP_HWBKPT, "hardware single-step" },
929 if (inf->fn(addr_if_watchpoint, esr, regs)) { in do_debug_exception()
930 arm64_notify_die(inf->name, regs, inf->sig, inf->code, pc, esr); in do_debug_exception()
950 if (vma->vm_flags & VM_MTE) in vma_alloc_zeroed_movable_folio()