From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756932Ab1KRLfj (ORCPT ); Fri, 18 Nov 2011 06:35:39 -0500 Received: from e28smtp07.in.ibm.com ([122.248.162.7]:52466 "EHLO e28smtp07.in.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756209Ab1KRLfe (ORCPT ); Fri, 18 Nov 2011 06:35:34 -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, 18 Nov 2011 16:39:23 +0530 Message-Id: <20111118110923.10512.69644.sendpatchset@srdronam.in.ibm.com> In-Reply-To: <20111118110631.10512.73274.sendpatchset@srdronam.in.ibm.com> References: <20111118110631.10512.73274.sendpatchset@srdronam.in.ibm.com> Subject: [PATCH v7 3.2-rc2 14/30] uprobe: register exception notifier x-cbid: 11111811-8878-0000-0000-000000446C43 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 9789b65..b9e1932 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; @@ -1229,6 +1230,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; @@ -1238,7 +1244,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)