Lines Matching +full:address +full:- +full:translation
1 // SPDX-License-Identifier: GPL-2.0-only
6 * Copyright (C) 1995-2004 Russell King
19 #include <linux/page-flags.h>
33 #include <asm/debug-monitors.h>
108 return __pa_symbol(mm->pgd); in mm_to_pgd_phys()
110 return (unsigned long)virt_to_phys(mm->pgd); in mm_to_pgd_phys()
124 mm = current->active_mm; in show_pte()
126 pr_alert("[%016lx] user address but active_mm is swapper\n", in show_pte()
134 pr_alert("[%016lx] address between user and kernel address ranges\n", in show_pte()
139 pr_alert("%s pgtable: %luk pages, %llu-bit VAs, pgdp=%016lx\n", in show_pte()
188 * like set_pte_at(), the PTE is never changed from no-exec to exec here.
193 unsigned long address, pte_t *ptep, in ptep_set_access_flags() argument
221 /* Invalidate a stale read-only entry */ in ptep_set_access_flags()
223 flush_tlb_page(vma, address); in ptep_set_access_flags()
246 (regs->pstate & PSR_PAN_BIT); in is_el1_permission_fault()
269 * If we now have a valid translation, treat the translation fault as in is_spurious_el1_translation_fault()
277 * treat the translation fault as spurious. in is_spurious_el1_translation_fault()
288 pr_alert("Unable to handle kernel %s at virtual address %016lx\n", msg, in die_kernel_fault()
312 "Ignoring spurious kernel translation fault at virtual address %016lx\n", addr)) in __do_kernel_fault()
317 msg = "write to read-only memory"; in __do_kernel_fault()
319 msg = "execute from non-executable memory"; in __do_kernel_fault()
331 static void set_thread_esr(unsigned long address, unsigned int esr) in set_thread_esr() argument
333 current->thread.fault_address = address; in set_thread_esr()
336 * If the faulting address is in the kernel, we must sanitize the ESR. in set_thread_esr()
337 * From userspace's point of view, kernel-only mappings don't exist in set_thread_esr()
338 * at all, so we report them as level 0 translation faults. in set_thread_esr()
341 * precedence over translation fault for a real access to empty in set_thread_esr()
344 * type", so we ignore this wrinkle and just return the translation in set_thread_esr()
347 if (!is_ttbr0_addr(current->thread.fault_address)) { in set_thread_esr()
365 * Claim a level 0 translation fault. in set_thread_esr()
385 current->thread.fault_code = esr; in set_thread_esr()
398 arm64_force_sig_fault(inf->sig, inf->code, (void __user *)addr, in do_bad_area()
399 inf->name); in do_bad_area()
421 if (unlikely(vma->vm_start > addr)) { in __do_page_fault()
422 if (!(vma->vm_flags & VM_GROWSDOWN)) in __do_page_fault()
432 if (!(vma->vm_flags & vm_flags)) in __do_page_fault()
455 struct mm_struct *mm = current->mm; in do_page_fault()
482 /* regs->orig_addr_limit may be 0 if we entered from EL0 */ in do_page_fault()
483 if (regs->orig_addr_limit == KERNEL_DS) in do_page_fault()
491 if (!search_exception_tables(regs->pc)) in do_page_fault()
504 if (!user_mode(regs) && !search_exception_tables(regs->pc)) in do_page_fault()
515 if (!user_mode(regs) && !search_exception_tables(regs->pc)) { in do_page_fault()
557 * oom-killed). in do_page_fault()
571 inf->name); in do_page_fault()
580 inf->name); in do_page_fault()
589 inf->name); in do_page_fault()
631 * APEI claimed this as a firmware-first notification. in do_sea()
641 arm64_notify_die(inf->name, regs, inf->sig, inf->code, siaddr, esr); in do_sea()
654 { do_bad, SIGKILL, SI_KERNEL, "ttbr address size fault" },
655 { do_bad, SIGKILL, SI_KERNEL, "level 1 address size fault" },
656 { do_bad, SIGKILL, SI_KERNEL, "level 2 address size fault" },
657 { do_bad, SIGKILL, SI_KERNEL, "level 3 address size fault" },
658 { do_translation_fault, SIGSEGV, SEGV_MAPERR, "level 0 translation fault" },
659 { do_translation_fault, SIGSEGV, SEGV_MAPERR, "level 1 translation fault" },
660 { do_translation_fault, SIGSEGV, SEGV_MAPERR, "level 2 translation fault" },
661 { do_translation_fault, SIGSEGV, SEGV_MAPERR, "level 3 translation fault" },
674 { do_sea, SIGKILL, SI_KERNEL, "level 0 (translation table walk)" },
675 { do_sea, SIGKILL, SI_KERNEL, "level 1 (translation table walk)" },
676 { do_sea, SIGKILL, SI_KERNEL, "level 2 (translation table walk)" },
677 { do_sea, SIGKILL, SI_KERNEL, "level 3 (translation table walk)" },
682 …{ do_sea, SIGKILL, SI_KERNEL, "level 0 synchronous parity error (translation table walk)" }, // R…
683 …{ do_sea, SIGKILL, SI_KERNEL, "level 1 synchronous parity error (translation table walk)" }, // R…
684 …{ do_sea, SIGKILL, SI_KERNEL, "level 2 synchronous parity error (translation table walk)" }, // R…
685 …{ do_sea, SIGKILL, SI_KERNEL, "level 3 synchronous parity error (translation table walk)" }, // R…
724 if (!inf->fn(addr, esr, regs)) in do_mem_abort()
733 arm64_notify_die(inf->name, regs, in do_mem_abort()
734 inf->sig, inf->code, (void __user *)addr, esr); in do_mem_abort()
758 * See traps.c and debug-monitors.c:debug_traps_init().
762 { do_bad, SIGTRAP, TRAP_HWBKPT, "hardware single-step" },
818 * that interrupts are re-enabled on the syscall path. Return back in cortex_a76_erratum_1463225_debug_handler()
823 regs->pstate |= PSR_D_BIT; in cortex_a76_erratum_1463225_debug_handler()
848 if (inf->fn(addr_if_watchpoint, esr, regs)) { in do_debug_exception()
849 arm64_notify_die(inf->name, regs, in do_debug_exception()
850 inf->sig, inf->code, (void __user *)pc, esr); in do_debug_exception()