diff options
-rw-r--r-- | arch/sparc/include/asm/pgtable_64.h | 2 | ||||
-rw-r--r-- | arch/sparc64/mm/fault.c | 37 |
2 files changed, 2 insertions, 37 deletions
diff --git a/arch/sparc/include/asm/pgtable_64.h b/arch/sparc/include/asm/pgtable_64.h index bb9ec2cce355..b049abf9902f 100644 --- a/arch/sparc/include/asm/pgtable_64.h +++ b/arch/sparc/include/asm/pgtable_64.h | |||
@@ -770,6 +770,8 @@ extern void sun4v_patch_tlb_handlers(void); | |||
770 | 770 | ||
771 | extern unsigned long cmdline_memory_size; | 771 | extern unsigned long cmdline_memory_size; |
772 | 772 | ||
773 | extern asmlinkage void do_sparc64_fault(struct pt_regs *regs); | ||
774 | |||
773 | #endif /* !(__ASSEMBLY__) */ | 775 | #endif /* !(__ASSEMBLY__) */ |
774 | 776 | ||
775 | #endif /* !(_SPARC64_PGTABLE_H) */ | 777 | #endif /* !(_SPARC64_PGTABLE_H) */ |
diff --git a/arch/sparc64/mm/fault.c b/arch/sparc64/mm/fault.c index ea7d7ae76bc2..a9e474bf6385 100644 --- a/arch/sparc64/mm/fault.c +++ b/arch/sparc64/mm/fault.c | |||
@@ -51,43 +51,6 @@ static inline int notify_page_fault(struct pt_regs *regs) | |||
51 | } | 51 | } |
52 | #endif | 52 | #endif |
53 | 53 | ||
54 | /* | ||
55 | * To debug kernel to catch accesses to certain virtual/physical addresses. | ||
56 | * Mode = 0 selects physical watchpoints, mode = 1 selects virtual watchpoints. | ||
57 | * flags = VM_READ watches memread accesses, flags = VM_WRITE watches memwrite accesses. | ||
58 | * Caller passes in a 64bit aligned addr, with mask set to the bytes that need to be | ||
59 | * watched. This is only useful on a single cpu machine for now. After the watchpoint | ||
60 | * is detected, the process causing it will be killed, thus preventing an infinite loop. | ||
61 | */ | ||
62 | void set_brkpt(unsigned long addr, unsigned char mask, int flags, int mode) | ||
63 | { | ||
64 | unsigned long lsubits; | ||
65 | |||
66 | __asm__ __volatile__("ldxa [%%g0] %1, %0" | ||
67 | : "=r" (lsubits) | ||
68 | : "i" (ASI_LSU_CONTROL)); | ||
69 | lsubits &= ~(LSU_CONTROL_PM | LSU_CONTROL_VM | | ||
70 | LSU_CONTROL_PR | LSU_CONTROL_VR | | ||
71 | LSU_CONTROL_PW | LSU_CONTROL_VW); | ||
72 | |||
73 | __asm__ __volatile__("stxa %0, [%1] %2\n\t" | ||
74 | "membar #Sync" | ||
75 | : /* no outputs */ | ||
76 | : "r" (addr), "r" (mode ? VIRT_WATCHPOINT : PHYS_WATCHPOINT), | ||
77 | "i" (ASI_DMMU)); | ||
78 | |||
79 | lsubits |= ((unsigned long)mask << (mode ? 25 : 33)); | ||
80 | if (flags & VM_READ) | ||
81 | lsubits |= (mode ? LSU_CONTROL_VR : LSU_CONTROL_PR); | ||
82 | if (flags & VM_WRITE) | ||
83 | lsubits |= (mode ? LSU_CONTROL_VW : LSU_CONTROL_PW); | ||
84 | __asm__ __volatile__("stxa %0, [%%g0] %1\n\t" | ||
85 | "membar #Sync" | ||
86 | : /* no outputs */ | ||
87 | : "r" (lsubits), "i" (ASI_LSU_CONTROL) | ||
88 | : "memory"); | ||
89 | } | ||
90 | |||
91 | static void __kprobes unhandled_fault(unsigned long address, | 54 | static void __kprobes unhandled_fault(unsigned long address, |
92 | struct task_struct *tsk, | 55 | struct task_struct *tsk, |
93 | struct pt_regs *regs) | 56 | struct pt_regs *regs) |