Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753104AbdI1K4d (ORCPT ); Thu, 28 Sep 2017 06:56:33 -0400 Received: from terminus.zytor.com ([65.50.211.136]:51215 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753085AbdI1K4c (ORCPT ); Thu, 28 Sep 2017 06:56:32 -0400 Date: Thu, 28 Sep 2017 03:52:58 -0700 From: tip-bot for Masami Hiramatsu Message-ID: Cc: linux-kernel@vger.kernel.org, torvalds@linux-foundation.org, paulmck@linux.vnet.ibm.com, peterz@infradead.org, ananth@linux.vnet.ibm.com, ast@kernel.org, ast@fb.com, mingo@kernel.org, rostedt@goodmis.org, hpa@zytor.com, mhiramat@kernel.org, tglx@linutronix.de Reply-To: peterz@infradead.org, paulmck@linux.vnet.ibm.com, ananth@linux.vnet.ibm.com, ast@kernel.org, ast@fb.com, linux-kernel@vger.kernel.org, torvalds@linux-foundation.org, hpa@zytor.com, mhiramat@kernel.org, tglx@linutronix.de, mingo@kernel.org, rostedt@goodmis.org In-Reply-To: <150581517952.32348.2655896843219158446.stgit@devbox> References: <150581517952.32348.2655896843219158446.stgit@devbox> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] kprobes/x86: Move the get_kprobe_ctlblk() into irq-disabled block Git-Commit-ID: cd52edad55fbcd8064877a77d31445b2fb4b85c3 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: 1931 Lines: 48 Commit-ID: cd52edad55fbcd8064877a77d31445b2fb4b85c3 Gitweb: https://git.kernel.org/tip/cd52edad55fbcd8064877a77d31445b2fb4b85c3 Author: Masami Hiramatsu AuthorDate: Tue, 19 Sep 2017 18:59:39 +0900 Committer: Ingo Molnar CommitDate: Thu, 28 Sep 2017 09:23:03 +0200 kprobes/x86: Move the get_kprobe_ctlblk() into irq-disabled block Since get_kprobe_ctlblk() accesses per-cpu variables which calls smp_processor_id(), it must be called under preempt-disabled or irq-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/150581517952.32348.2655896843219158446.stgit@devbox Signed-off-by: Ingo Molnar --- arch/x86/kernel/kprobes/opt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/kprobes/opt.c b/arch/x86/kernel/kprobes/opt.c index 0cae7c0..f558103 100644 --- a/arch/x86/kernel/kprobes/opt.c +++ b/arch/x86/kernel/kprobes/opt.c @@ -154,7 +154,6 @@ STACK_FRAME_NON_STANDARD(optprobe_template_func); static void optimized_callback(struct optimized_kprobe *op, struct pt_regs *regs) { - struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); unsigned long flags; /* This is possible if op is under delayed unoptimizing */ @@ -165,6 +164,7 @@ optimized_callback(struct optimized_kprobe *op, struct pt_regs *regs) if (kprobe_running()) { kprobes_inc_nmissed_count(&op->kp); } else { + struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); /* Save skipped registers */ #ifdef CONFIG_X86_64 regs->cs = __KERNEL_CS;