From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967930AbdEZIuv (ORCPT ); Fri, 26 May 2017 04:50:51 -0400 Received: from terminus.zytor.com ([65.50.211.136]:43033 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967198AbdEZIut (ORCPT ); Fri, 26 May 2017 04:50:49 -0400 Date: Fri, 26 May 2017 01:46:10 -0700 From: tip-bot for Thomas Gleixner Message-ID: Cc: linux@armlinux.org.uk, linux-kernel@vger.kernel.org, tglx@linutronix.de, peterz@infradead.org, rostedt@goodmis.org, bigeasy@linutronix.de, mingo@kernel.org, paulmck@linux.vnet.ibm.com, hpa@zytor.com Reply-To: rostedt@goodmis.org, bigeasy@linutronix.de, mingo@kernel.org, hpa@zytor.com, paulmck@linux.vnet.ibm.com, linux@armlinux.org.uk, linux-kernel@vger.kernel.org, tglx@linutronix.de, peterz@infradead.org In-Reply-To: <20170524081549.275871311@linutronix.de> References: <20170524081549.275871311@linutronix.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:smp/hotplug] arm: Prevent hotplug rwsem recursion Git-Commit-ID: 9489cc8f370be811f7e741a772bcce88b712272d 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 Commit-ID: 9489cc8f370be811f7e741a772bcce88b712272d Gitweb: http://git.kernel.org/tip/9489cc8f370be811f7e741a772bcce88b712272d Author: Thomas Gleixner AuthorDate: Wed, 24 May 2017 10:15:38 +0200 Committer: Thomas Gleixner CommitDate: Fri, 26 May 2017 10:10:46 +0200 arm: Prevent hotplug rwsem recursion The text patching functions which are invoked from jump_label and kprobes code are protected against cpu hotplug at the call sites. Use stop_machine_cpuslocked() to avoid recursion on the cpu hotplug rwsem. stop_machine_cpuslocked() contains a lockdep assertion to catch any unprotected callers. Signed-off-by: Thomas Gleixner Acked-by: Ingo Molnar Cc: Paul E. McKenney Cc: Peter Zijlstra Cc: Sebastian Siewior Cc: Steven Rostedt Cc: Russell King Cc: linux-arm-kernel@lists.infradead.org Link: http://lkml.kernel.org/r/20170524081549.275871311@linutronix.de --- arch/arm/kernel/patch.c | 2 +- arch/arm/probes/kprobes/core.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/arm/kernel/patch.c b/arch/arm/kernel/patch.c index 020560b..a1a3472 100644 --- a/arch/arm/kernel/patch.c +++ b/arch/arm/kernel/patch.c @@ -124,5 +124,5 @@ void __kprobes patch_text(void *addr, unsigned int insn) .insn = insn, }; - stop_machine(patch_text_stop_machine, &patch, NULL); + stop_machine_cpuslocked(patch_text_stop_machine, &patch, NULL); } diff --git a/arch/arm/probes/kprobes/core.c b/arch/arm/probes/kprobes/core.c index ad1f4e6..52d1cd1 100644 --- a/arch/arm/probes/kprobes/core.c +++ b/arch/arm/probes/kprobes/core.c @@ -182,7 +182,8 @@ void __kprobes kprobes_remove_breakpoint(void *addr, unsigned int insn) .addr = addr, .insn = insn, }; - stop_machine(__kprobes_remove_breakpoint, &p, cpu_online_mask); + stop_machine_cpuslocked(__kprobes_remove_breakpoint, &p, + cpu_online_mask); } void __kprobes arch_disarm_kprobe(struct kprobe *p)