]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - include/linux/kprobes.h
Revert "drm/amdkfd: New IOCTL to allocate queue GWS"
[linux.git] / include / linux / kprobes.h
index 443d9800ca3f822855703fb26d22614ff82694bd..04bdaf01112cbd820bb8b4ac7c37353057b6f3f1 100644 (file)
@@ -458,4 +458,23 @@ static inline bool is_kprobe_optinsn_slot(unsigned long addr)
 }
 #endif
 
+/* Returns true if kprobes handled the fault */
+static nokprobe_inline bool kprobe_page_fault(struct pt_regs *regs,
+                                             unsigned int trap)
+{
+       if (!kprobes_built_in())
+               return false;
+       if (user_mode(regs))
+               return false;
+       /*
+        * To be potentially processing a kprobe fault and to be allowed
+        * to call kprobe_running(), we have to be non-preemptible.
+        */
+       if (preemptible())
+               return false;
+       if (!kprobe_running())
+               return false;
+       return kprobe_fault_handler(regs, trap);
+}
+
 #endif /* _LINUX_KPROBES_H */