fault.c (2383050f6a3a2e00636eabfcf66445af653ddd80) | fault.c (2dd0e8d2d2a157dbc83295a78336c2217110f2f8) |
---|---|
1/* 2 * Based on arch/arm/mm/fault.c 3 * 4 * Copyright (C) 1995 Linus Torvalds 5 * Copyright (C) 1995-2004 Russell King 6 * Copyright (C) 2012 ARM Ltd. 7 * 8 * This program is free software; you can redistribute it and/or modify --- 27 unchanged lines hidden (view full) --- 36#include <asm/esr.h> 37#include <asm/sysreg.h> 38#include <asm/system_misc.h> 39#include <asm/pgtable.h> 40#include <asm/tlbflush.h> 41 42static const char *fault_name(unsigned int esr); 43 | 1/* 2 * Based on arch/arm/mm/fault.c 3 * 4 * Copyright (C) 1995 Linus Torvalds 5 * Copyright (C) 1995-2004 Russell King 6 * Copyright (C) 2012 ARM Ltd. 7 * 8 * This program is free software; you can redistribute it and/or modify --- 27 unchanged lines hidden (view full) --- 36#include <asm/esr.h> 37#include <asm/sysreg.h> 38#include <asm/system_misc.h> 39#include <asm/pgtable.h> 40#include <asm/tlbflush.h> 41 42static const char *fault_name(unsigned int esr); 43 |
44#ifdef CONFIG_KPROBES 45static inline int notify_page_fault(struct pt_regs *regs, unsigned int esr) 46{ 47 int ret = 0; 48 49 /* kprobe_running() needs smp_processor_id() */ 50 if (!user_mode(regs)) { 51 preempt_disable(); 52 if (kprobe_running() && kprobe_fault_handler(regs, esr)) 53 ret = 1; 54 preempt_enable(); 55 } 56 57 return ret; 58} 59#else 60static inline int notify_page_fault(struct pt_regs *regs, unsigned int esr) 61{ 62 return 0; 63} 64#endif 65 |
|
44/* 45 * Dump out the page tables associated with 'addr' in mm 'mm'. 46 */ 47void show_pte(struct mm_struct *mm, unsigned long addr) 48{ 49 pgd_t *pgd; 50 51 if (!mm) --- 202 unchanged lines hidden (view full) --- 254 struct pt_regs *regs) 255{ 256 struct task_struct *tsk; 257 struct mm_struct *mm; 258 int fault, sig, code; 259 unsigned long vm_flags = VM_READ | VM_WRITE | VM_EXEC; 260 unsigned int mm_flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE; 261 | 66/* 67 * Dump out the page tables associated with 'addr' in mm 'mm'. 68 */ 69void show_pte(struct mm_struct *mm, unsigned long addr) 70{ 71 pgd_t *pgd; 72 73 if (!mm) --- 202 unchanged lines hidden (view full) --- 276 struct pt_regs *regs) 277{ 278 struct task_struct *tsk; 279 struct mm_struct *mm; 280 int fault, sig, code; 281 unsigned long vm_flags = VM_READ | VM_WRITE | VM_EXEC; 282 unsigned int mm_flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE; 283 |
284 if (notify_page_fault(regs, esr)) 285 return 0; 286 |
|
262 tsk = current; 263 mm = tsk->mm; 264 265 /* 266 * If we're in an interrupt or have no user context, we must not take 267 * the fault. 268 */ 269 if (faulthandler_disabled() || !mm) --- 354 unchanged lines hidden (view full) --- 624 rv = 0; 625 } 626 627 if (interrupts_enabled(regs)) 628 trace_hardirqs_on(); 629 630 return rv; 631} | 287 tsk = current; 288 mm = tsk->mm; 289 290 /* 291 * If we're in an interrupt or have no user context, we must not take 292 * the fault. 293 */ 294 if (faulthandler_disabled() || !mm) --- 354 unchanged lines hidden (view full) --- 649 rv = 0; 650 } 651 652 if (interrupts_enabled(regs)) 653 trace_hardirqs_on(); 654 655 return rv; 656} |
657NOKPROBE_SYMBOL(do_debug_exception); |
|
632 633#ifdef CONFIG_ARM64_PAN 634void cpu_enable_pan(void *__unused) 635{ 636 config_sctlr_el1(SCTLR_EL1_SPAN, 0); 637} 638#endif /* CONFIG_ARM64_PAN */ 639 --- 12 unchanged lines hidden --- | 658 659#ifdef CONFIG_ARM64_PAN 660void cpu_enable_pan(void *__unused) 661{ 662 config_sctlr_el1(SCTLR_EL1_SPAN, 0); 663} 664#endif /* CONFIG_ARM64_PAN */ 665 --- 12 unchanged lines hidden --- |