From mboxrd@z Thu Jan 1 00:00:00 1970 From: Masami Hiramatsu Subject: [PATCH -tip RFC v2 12/22] x86/hw_breakpoint: Use NOKPROBE_SYMBOL macro in hw_breakpoint Date: Fri, 15 Nov 2013 04:53:50 +0000 Message-ID: <20131115045350.27580.76405.stgit@kbuild-fedora.novalocal> References: <20131115045312.27580.95902.stgit@kbuild-fedora.novalocal> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Return-path: Received: from mail9.hitachi.co.jp ([133.145.228.44]:57612 "EHLO mail9.hitachi.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758150Ab3KOExz (ORCPT ); Thu, 14 Nov 2013 23:53:55 -0500 In-Reply-To: <20131115045312.27580.95902.stgit@kbuild-fedora.novalocal> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Ingo Molnar Cc: linux-arch@vger.kernel.org, Ananth N Mavinakayanahalli , x86@kernel.org, Oleg Nesterov , lkml , "Steven Rostedt (Red Hat)" , virtualization@lists.linux-foundation.org, Andrew Morton , Ingo Molnar , "H. Peter Anvin" , Thomas Gleixner , "David S. Miller" Use NOKPROBE_SYMBOL macro to protect functions from kprobes instead of __kprobe annotation in hw_breakpoint. Signed-off-by: Masami Hiramatsu Cc: Thomas Gleixner Cc: Ingo Molnar Cc: "H. Peter Anvin" Cc: Andrew Morton Cc: Oleg Nesterov --- arch/x86/kernel/hw_breakpoint.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/hw_breakpoint.c b/arch/x86/kernel/hw_breakpoint.c index f66ff16..cb4df84 100644 --- a/arch/x86/kernel/hw_breakpoint.c +++ b/arch/x86/kernel/hw_breakpoint.c @@ -425,7 +425,7 @@ EXPORT_SYMBOL_GPL(hw_breakpoint_restore); * NOTIFY_STOP returned for all other cases * */ -static int __kprobes hw_breakpoint_handler(struct die_args *args) +static int hw_breakpoint_handler(struct die_args *args) { int i, cpu, rc = NOTIFY_STOP; struct perf_event *bp; @@ -508,11 +508,12 @@ static int __kprobes hw_breakpoint_handler(struct die_args *args) return rc; } +NOKPROBE_SYMBOL(hw_breakpoint_handler); /* * Handle debug exception notifications. */ -int __kprobes hw_breakpoint_exceptions_notify( +int hw_breakpoint_exceptions_notify( struct notifier_block *unused, unsigned long val, void *data) { if (val != DIE_DEBUG) @@ -520,6 +521,7 @@ int __kprobes hw_breakpoint_exceptions_notify( return hw_breakpoint_handler(data); } +NOKPROBE_SYMBOL(hw_breakpoint_exceptions_notify); void hw_breakpoint_pmu_read(struct perf_event *bp) {