From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932550AbcHCOlM (ORCPT ); Wed, 3 Aug 2016 10:41:12 -0400 Received: from mail.kernel.org ([198.145.29.136]:47490 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932374AbcHCOlK (ORCPT ); Wed, 3 Aug 2016 10:41:10 -0400 Date: Wed, 3 Aug 2016 23:31:53 +0900 From: Masami Hiramatsu To: Pratyush Anand Cc: open list , Oleg Nesterov , srikar@linux.vnet.ibm.com, Alexander Shishkin , Arnaldo Carvalho de Melo , Ingo Molnar , Peter Zijlstra Subject: Re: [PATCH] uprobe: Add uprobe_pre/post_sstep_notifier to NOKPROBE_SYMBOL Message-Id: <20160803233153.48b13b067fa30560dcce6e96@kernel.org> In-Reply-To: References: <66dfa2cb82fc306d42e51adf0f5d819b4695644e.1470120173.git.panand@redhat.com> <20160803004524.760a8398c7525852bf26a29d@kernel.org> <20160803042454.GB18785@localhost.localdomain> X-Mailer: Sylpheed 3.5.0 (GTK+ 2.24.30; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 3 Aug 2016 16:05:34 +0530 Pratyush Anand wrote: > On Wed, Aug 3, 2016 at 9:54 AM, Pratyush Anand wrote: > > Hi Masami, > > > > On 03/08/2016:12:45:24 AM, Masami Hiramatsu wrote: > >> On Tue, 2 Aug 2016 12:14:06 +0530 > >> Pratyush Anand wrote: > >> > >> > uprobe_pre_sstep_notifier and uprobe_post_sstep_notifier are called from > >> > debug exception handler, so blacklist them for kprobing. > >> > >> Actually, these exception notifers are kicked only if the debug exception > >> is not related to kprobes (at least on x86). In that case, we don't have > >> to take care about that. Or, would you hit any problem on it? > > > > Well, I have faced issue on ARM64. So, if I have a kprobe instrumented at these > > functions and then if I hit a uprobe then kernel goes into an infinite loop of > > "Unexpected kernel single-step exception at EL1". > > > > On x86 I have not tested, but I see that all functions except > > arch_uprobe_exception_notify() in the call stack of > > uprobe_pre/post_sstep_notifier() are blacklisted for kprobe. So, I am unable to > > understand that why arch_uprobe_exception_notify() and > > uprobe_pre/post_sstep_notifier() are not blacklisted. > > > >> > >> IOW, where do we have to prohibit kprobes are, the code path from where > >> right after the breakpoint (debug) exception is occurred, to where right > >> before the kprobe is handled. After that, it should be safe. > > > > Hummmm...My understanding was that if a function a() is not good to be kprobed > > then we can not kprobe any function called by a() as well. Thanks for the > > clarification. So, if I go with your definition then, something is still wrong on > > ARM64 which is causing issue when I kprobe uprobe_pre/post_sstep_notifier(). > > I found that one modification in ARM64 kprobe code allows me to kprobe > uprobe_pre/post_sstep_notifier(). So, taking back this patch. Will > discuss ARM64 modification on arm mailing list. OK, so that will be ARM64 specific issue. We'd better to trace it. Thank you for your effort!! > > Thanks Masami for your input. > > ~Pratyush -- Masami Hiramatsu