From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752439AbcJDHGe (ORCPT ); Tue, 4 Oct 2016 03:06:34 -0400 Received: from merlin.infradead.org ([205.233.59.134]:33784 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750908AbcJDHGd (ORCPT ); Tue, 4 Oct 2016 03:06:33 -0400 Date: Tue, 4 Oct 2016 09:06:18 +0200 From: Peter Zijlstra To: Michael Ellerman Cc: Jiri Olsa , Michael Neuling , Paul Mackerras , Jiri Olsa , lkml , Ingo Molnar , Alexander Shishkin , Jan Stancek , Will Deacon Subject: Re: [PATCH] perf powerpc: Don't call perf_event_disable from atomic context Message-ID: <20161004070618.GL3318@worktop.controleur.wifipass.org> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87shsc4tzm.fsf@concordia.ellerman.id.au> User-Agent: Mutt/1.5.22.1 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 should fix emulate_step() if it failed to emulate something it > should have, but there will always be the possibility that it fails. > > Instead of calling perf_event_disable() we could just add a flag to > arch_hw_breakpoint that says we hit an error on the event, and block > reinstalling it in arch_install_hw_breakpoint(). Possible..