From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755638Ab1KJTFd (ORCPT ); Thu, 10 Nov 2011 14:05:33 -0500 Received: from e23smtp08.au.ibm.com ([202.81.31.141]:35199 "EHLO e23smtp08.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932102Ab1KJTF2 (ORCPT ); Thu, 10 Nov 2011 14:05:28 -0500 From: Srikar Dronamraju To: Peter Zijlstra , Linus Torvalds Cc: Oleg Nesterov , Andrew Morton , LKML , Linux-mm , Ingo Molnar , Andi Kleen , Christoph Hellwig , Steven Rostedt , Roland McGrath , Thomas Gleixner , Masami Hiramatsu , Arnaldo Carvalho de Melo , Anton Arapov , Ananth N Mavinakayanahalli , Jim Keniston , Stephen Wilson Date: Fri, 11 Nov 2011 00:10:16 +0530 Message-Id: <20111110184016.11361.91824.sendpatchset@srdronam.in.ibm.com> In-Reply-To: <20111110183725.11361.57827.sendpatchset@srdronam.in.ibm.com> References: <20111110183725.11361.57827.sendpatchset@srdronam.in.ibm.com> Subject: [PATCH v6 3.2-rc1 14/28] uprobe: register exception notifier x-cbid: 11111009-5140-0000-0000-00000033D8F6 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use the notifier mechanism to register uprobes exception notifier. Signed-off-by: Ananth N Mavinakayanahalli Signed-off-by: Srikar Dronamraju --- kernel/uprobes.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/kernel/uprobes.c b/kernel/uprobes.c index 2461b20..c4ccb89 100644 --- a/kernel/uprobes.c +++ b/kernel/uprobes.c @@ -30,6 +30,7 @@ #include /* set_pte_at_notify */ #include /* try_to_free_swap */ #include /* user_enable_single_step */ +#include /* notifier mechanism */ #include static bulkref_t uprobes_srcu; @@ -1235,6 +1236,11 @@ int uprobe_post_notifier(struct pt_regs *regs) return 1; } +struct notifier_block uprobe_exception_nb = { + .notifier_call = uprobe_exception_notify, + .priority = INT_MAX - 1, /* notified after kprobes, kgdb */ +}; + static int __init init_uprobes(void) { int i; @@ -1244,7 +1250,7 @@ static int __init init_uprobes(void) mutex_init(&uprobes_mmap_mutex[i]); } init_bulkref(&uprobes_srcu); - return 0; + return register_die_notifier(&uprobe_exception_nb); } static void __exit exit_uprobes(void)