Lines Matching +full:entry +full:- +full:address

1 // SPDX-License-Identifier: GPL-2.0
38 #include <asm/asm-extable.h>
39 #include <asm/asm-offsets.h>
47 #include "../kernel/entry.h"
60 * Find out which address space caused the exception.
64 union teid teid = { .val = regs->int_parm_long }; in is_kernel_fault()
75 union teid teid = { .val = regs->int_parm_long }; in get_fault_address()
82 union teid teid = { .val = regs->int_parm_long }; in fault_is_write()
89 static void dump_pagetable(unsigned long asce, unsigned long address) in dump_pagetable() argument
91 unsigned long entry, *table = __va(asce & _ASCE_ORIGIN); in dump_pagetable() local
96 table += (address & _REGION1_INDEX) >> _REGION1_SHIFT; in dump_pagetable()
97 if (get_kernel_nofault(entry, table)) in dump_pagetable()
99 pr_cont("R1:%016lx ", entry); in dump_pagetable()
100 if (entry & _REGION_ENTRY_INVALID) in dump_pagetable()
102 table = __va(entry & _REGION_ENTRY_ORIGIN); in dump_pagetable()
105 table += (address & _REGION2_INDEX) >> _REGION2_SHIFT; in dump_pagetable()
106 if (get_kernel_nofault(entry, table)) in dump_pagetable()
108 pr_cont("R2:%016lx ", entry); in dump_pagetable()
109 if (entry & _REGION_ENTRY_INVALID) in dump_pagetable()
111 table = __va(entry & _REGION_ENTRY_ORIGIN); in dump_pagetable()
114 table += (address & _REGION3_INDEX) >> _REGION3_SHIFT; in dump_pagetable()
115 if (get_kernel_nofault(entry, table)) in dump_pagetable()
117 pr_cont("R3:%016lx ", entry); in dump_pagetable()
118 if (entry & (_REGION_ENTRY_INVALID | _REGION3_ENTRY_LARGE)) in dump_pagetable()
120 table = __va(entry & _REGION_ENTRY_ORIGIN); in dump_pagetable()
123 table += (address & _SEGMENT_INDEX) >> _SEGMENT_SHIFT; in dump_pagetable()
124 if (get_kernel_nofault(entry, table)) in dump_pagetable()
126 pr_cont("S:%016lx ", entry); in dump_pagetable()
127 if (entry & (_SEGMENT_ENTRY_INVALID | _SEGMENT_ENTRY_LARGE)) in dump_pagetable()
129 table = __va(entry & _SEGMENT_ENTRY_ORIGIN); in dump_pagetable()
131 table += (address & _PAGE_INDEX) >> PAGE_SHIFT; in dump_pagetable()
132 if (get_kernel_nofault(entry, table)) in dump_pagetable()
134 pr_cont("P:%016lx ", entry); in dump_pagetable()
144 union teid teid = { .val = regs->int_parm_long }; in dump_fault_info()
147 pr_alert("Failing address: %016lx TEID: %016lx\n", in dump_fault_info()
166 asce = get_lowcore()->kernel_asce.val; in dump_fault_info()
169 asce = get_lowcore()->user_asce.val; in dump_fault_info()
189 regs->int_code & 0xffff, regs->int_code >> 17); in report_user_fault()
190 print_vma_addr(KERN_CONT "in ", regs->psw.addr); in report_user_fault()
205 unsigned long address; in handle_fault_error_nolock() local
216 address = get_fault_address(regs); in handle_fault_error_nolock()
218 if (kfence_handle_page_fault(address, is_write, regs)) in handle_fault_error_nolock()
220 pr_alert("Unable to handle kernel pointer dereference in virtual kernel address space\n"); in handle_fault_error_nolock()
222 pr_alert("Unable to handle kernel paging request in virtual user address space\n"); in handle_fault_error_nolock()
230 struct mm_struct *mm = current->mm; in handle_fault_error()
242 * This routine handles page faults. It determines the address,
247 * 04 Protection -> Write-Protection (suppression)
248 * 10 Segment translation -> Not present (nullification)
249 * 11 Page translation -> Not present (nullification)
250 * 3b Region third trans. -> Not present (nullification)
255 unsigned long address; in do_exception() local
268 mm = current->mm; in do_exception()
269 address = get_fault_address(regs); in do_exception()
273 perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, address); in do_exception()
283 vma = lock_vma_under_rcu(mm, address); in do_exception()
286 if (!(vma->vm_flags & access)) { in do_exception()
291 fault = handle_mm_fault(vma, address, flags | FAULT_FLAG_VMA_LOCK, regs); in do_exception()
309 vma = lock_mm_and_find_vma(mm, address, regs); in do_exception()
312 if (unlikely(!(vma->vm_flags & access))) in do_exception()
314 fault = handle_mm_fault(vma, address, flags, regs); in do_exception()
355 union teid teid = { .val = regs->int_parm_long }; in do_protection_exception()
358 * Protection exceptions are suppressing, decrement psw address. in do_protection_exception()
362 if (!(regs->int_code & 0x200)) in do_protection_exception()
363 regs->psw.addr = __rewind_psw(regs->psw, regs->int_code >> 16); in do_protection_exception()
365 * Check for low-address protection. This needs to be treated in do_protection_exception()
371 /* Low-address protection in user mode: cannot happen */ in do_protection_exception()
372 die(regs, "Low-address protection"); in do_protection_exception()
375 * Low-address protection in kernel mode means in do_protection_exception()
381 regs->int_parm_long = (teid.addr * PAGE_SIZE) | (regs->psw.addr & PAGE_MASK); in do_protection_exception()
398 union teid teid = { .val = regs->int_parm_long }; in do_secure_storage_access()
407 * Bit 61 indicates if the address is valid, if it is not the in do_secure_storage_access()
437 mm = current->mm; in do_secure_storage_access()