Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752997AbdI1K5V (ORCPT ); Thu, 28 Sep 2017 06:57:21 -0400 Received: from terminus.zytor.com ([65.50.211.136]:54813 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752777AbdI1K5T (ORCPT ); Thu, 28 Sep 2017 06:57:19 -0400 Date: Thu, 28 Sep 2017 03:53:46 -0700 From: tip-bot for Masami Hiramatsu Message-ID: Cc: mingo@kernel.org, ast@fb.com, mhiramat@kernel.org, linux-kernel@vger.kernel.org, paulmck@linux.vnet.ibm.com, rostedt@goodmis.org, torvalds@linux-foundation.org, ast@kernel.org, peterz@infradead.org, hpa@zytor.com, tglx@linutronix.de, ananth@linux.vnet.ibm.com Reply-To: tglx@linutronix.de, hpa@zytor.com, ast@kernel.org, peterz@infradead.org, torvalds@linux-foundation.org, ananth@linux.vnet.ibm.com, paulmck@linux.vnet.ibm.com, mhiramat@kernel.org, linux-kernel@vger.kernel.org, ast@fb.com, mingo@kernel.org, rostedt@goodmis.org In-Reply-To: <150581525942.32348.6359217983269060829.stgit@devbox> References: <150581525942.32348.6359217983269060829.stgit@devbox> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] kprobes/x86: Disable preemption in optprobe Git-Commit-ID: 9a09f261a4fa52de916b0db34a36956c95f78fdc X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1804 Lines: 49 Commit-ID: 9a09f261a4fa52de916b0db34a36956c95f78fdc Gitweb: https://git.kernel.org/tip/9a09f261a4fa52de916b0db34a36956c95f78fdc Author: Masami Hiramatsu AuthorDate: Tue, 19 Sep 2017 19:00:59 +0900 Committer: Ingo Molnar CommitDate: Thu, 28 Sep 2017 09:23:04 +0200 kprobes/x86: Disable preemption in optprobe Disable preemption in optprobe handler as described in Documentation/kprobes.txt, which says: "Probe handlers are run with preemption disabled." Signed-off-by: Masami Hiramatsu Cc: Alexei Starovoitov Cc: Alexei Starovoitov Cc: Ananth N Mavinakayanahalli Cc: Linus Torvalds Cc: Paul E . McKenney Cc: Peter Zijlstra Cc: Steven Rostedt Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/150581525942.32348.6359217983269060829.stgit@devbox Signed-off-by: Ingo Molnar --- arch/x86/kernel/kprobes/opt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/kernel/kprobes/opt.c b/arch/x86/kernel/kprobes/opt.c index f558103..32c35cb 100644 --- a/arch/x86/kernel/kprobes/opt.c +++ b/arch/x86/kernel/kprobes/opt.c @@ -161,6 +161,7 @@ optimized_callback(struct optimized_kprobe *op, struct pt_regs *regs) return; local_irq_save(flags); + preempt_disable(); if (kprobe_running()) { kprobes_inc_nmissed_count(&op->kp); } else { @@ -180,6 +181,7 @@ optimized_callback(struct optimized_kprobe *op, struct pt_regs *regs) opt_pre_handler(&op->kp, regs); __this_cpu_write(current_kprobe, NULL); } + preempt_enable_no_resched(); local_irq_restore(flags); } NOKPROBE_SYMBOL(optimized_callback);