From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752694AbcJJNTm (ORCPT ); Mon, 10 Oct 2016 09:19:42 -0400 Received: from foss.arm.com ([217.140.101.70]:47040 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752431AbcJJNTW (ORCPT ); Mon, 10 Oct 2016 09:19:22 -0400 Date: Mon, 10 Oct 2016 14:19:02 +0100 From: Will Deacon To: Peter Zijlstra Cc: Michael Ellerman , Jiri Olsa , Michael Neuling , Paul Mackerras , Jiri Olsa , lkml , Ingo Molnar , Alexander Shishkin , Jan Stancek Subject: Re: [PATCH] perf powerpc: Don't call perf_event_disable from atomic context Message-ID: <20161010131902.GL3417@arm.com> References: <1474466134-21823-1-git-send-email-jolsa@kernel.org> <20160923163747.GE5012@twins.programming.kicks-ass.net> <20161003132932.GA28947@krava> <20161003134740.GC3117@twins.programming.kicks-ass.net> <87shsc4tzm.fsf@concordia.ellerman.id.au> <20161004070618.GL3318@worktop.controleur.wifipass.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161004070618.GL3318@worktop.controleur.wifipass.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 04, 2016 at 09:06:18AM +0200, Peter Zijlstra wrote: > On Tue, Oct 04, 2016 at 03:29:33PM +1100, Michael Ellerman wrote: > > Peter Zijlstra writes: > > > So it would be good to also explain why PPC needs this in the first > > > place. > > > > Unfortunately I don't really know the code, and the original author is AWOL. > > > > But AFAICS perf_event_disable() is only called here: > > > > if (!stepped) { > > WARN(1, "Unable to handle hardware breakpoint. Breakpoint at " > > "0x%lx will be disabled.", info->address); > > perf_event_disable(bp); > > goto out; > > } > > > > Which is where we cope with the possibility that we couldn't emulate the > > instruction that hit the breakpoint. Seems that is not an issue on x86, > > or it's handled elsewhere? > > I don't think x86 ever needs to emulate things on hw breakpoint > (although I could be mistaken), but I would expect ARM to maybe need > so, and I couldn't find a disable there either. > > Will? We don't do any emulation, so no need for us to call perf_event_disable in the hw_breakpoint "overflow" path. We do play some awful games to fake up a single-step, but I don't think perf core needs to care about it. Will