Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp6017547ybv; Tue, 18 Feb 2020 08:17:18 -0800 (PST) X-Google-Smtp-Source: APXvYqylm5Ch1iqHw2qsekXHsQDJTKh0QyRSj3m9EmY8yOsmfMCxQSuETRguBJ57y038yJGdDyUA X-Received: by 2002:a05:6808:487:: with SMTP id z7mr1758014oid.59.1582042638557; Tue, 18 Feb 2020 08:17:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582042638; cv=none; d=google.com; s=arc-20160816; b=c4QiYoOd0NotwBQw+TzOR1YYnLZdCuRAz5uFLWnhpJ4TT3wnD5h5XmBQ4xPWjD7CgC iyPkD9o2uXF/O6LuBar90XTuWRZ8hvRPzlJVv99RzjzrtORKfwpRIJQqXKMLk8vNiE7r xCLxtnddFhr1Rd5+RFnQFOb4DTKHxZQTjCATRlPPDzBItLCLril5X88SJOBh23WV+KMb 1kL00QVeQHc+O3QPEmwscJrxaZACb8pNAbEKmEXlqAFeOpAogTGWpq4pfQoPj50f8Kr0 yqzbTGAplFa+1q+qsKjWh9tohKUFJo60YaKFJEH1Voy5+XiiSZzBPPVndFr/Ua1OFOcg zv6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:thread-index:thread-topic :content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:dkim-signature:dkim-filter; bh=5UEGMAe09c0uhoyr1w31js41MQsx532sjq0P/JWOjIo=; b=r54/vcRhqAwTYVXEUnm4o6jE8DHHHFhWqP/lbdU3QwTZM/5EdOthNi0BPdVG/Nw48y fH3ytbn1w/bJgkaheKz9cxnXexRgxnwpZBLBVoizCIamBqTU7rwXxIZFtaNi1EavcTLD 9NZ++18Fnxdaex7FGPcLJ8kPOBI9383pbJMTj6cQgOwls2jy/SJMWktx5Mjcxri7eiie HJtMt5UwANng+zqCGaUOjCUEPVpzhuEKSK5yYxZpgGKfB2WjoHQpfQAbU0rhtsKziv75 mBYgRft1ttvEfHMVPueJE3DZIc9GoHf0ATdiv+hmswsfGaXZHVxexZT0RObH0JGHHecl qiVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@efficios.com header.s=default header.b=DqRQgGg3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m4si1916546otn.281.2020.02.18.08.17.05; Tue, 18 Feb 2020 08:17:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@efficios.com header.s=default header.b=DqRQgGg3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726549AbgBRQPd (ORCPT + 99 others); Tue, 18 Feb 2020 11:15:33 -0500 Received: from mail.efficios.com ([167.114.26.124]:42580 "EHLO mail.efficios.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726360AbgBRQPc (ORCPT ); Tue, 18 Feb 2020 11:15:32 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id 58D4B256DF3; Tue, 18 Feb 2020 11:15:31 -0500 (EST) Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id tmNNx4F-udVa; Tue, 18 Feb 2020 11:15:31 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id E0BEF2578A4; Tue, 18 Feb 2020 11:15:30 -0500 (EST) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com E0BEF2578A4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficios.com; s=default; t=1582042530; bh=5UEGMAe09c0uhoyr1w31js41MQsx532sjq0P/JWOjIo=; h=Date:From:To:Message-ID:MIME-Version; b=DqRQgGg3QaKuaJ/KHVfwr0hX0w8rcR/sm/1Q5yrVteFd7E1ClYUdUzAsa9MfANy4b BzcHqVH3e5L0RKghM+TFjdBrjxwYepZYej/+FJMw85oFlSrcbgMvTvCsD9JsHKYUUr 9bzmwQpLzOTVoZ/G08+wmGY/r9oBSqib7jES4/hsKiwcpQ1SX/s7ZkcynBayNUWxhs Ko6WU+ylzrHJW2O6hRk+oZYu36SNssSt9N/OkVfx1fJZtyKAW0O5iW1PBabqsueVLy ta1I+dMO3R/Uk1hoRgeh0u/6bpQfmFZ5ftz8ykJCYQvMKB1Bdft9KW6GS+IdJuVeFB 1U4vxRMXsyN3Q== X-Virus-Scanned: amavisd-new at efficios.com Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Mycul7_S9TMN; Tue, 18 Feb 2020 11:15:30 -0500 (EST) Received: from mail03.efficios.com (mail03.efficios.com [167.114.26.124]) by mail.efficios.com (Postfix) with ESMTP id CACF2256DB5; Tue, 18 Feb 2020 11:15:30 -0500 (EST) Date: Tue, 18 Feb 2020 11:15:30 -0500 (EST) From: Mathieu Desnoyers To: paulmck , Masami Hiramatsu Cc: rostedt , "Joel Fernandes, Google" , Peter Zijlstra , linux-kernel , linux-arch , Ingo Molnar , Greg Kroah-Hartman , "Gustavo A. R. Silva" , Thomas Gleixner , Josh Triplett , Lai Jiangshan Message-ID: <1841874582.7975.1582042530726.JavaMail.zimbra@efficios.com> In-Reply-To: <20200218161231.GD2935@paulmck-ThinkPad-P72> References: <20200213211930.GG170680@google.com> <20200213223918.GN2935@paulmck-ThinkPad-P72> <20200214151906.b1354a7ed6b01fc3bf2de862@kernel.org> <20200215145934.GD2935@paulmck-ThinkPad-P72> <20200217175519.12a694a969c1a8fb2e49905e@kernel.org> <20200217163112.GM2935@paulmck-ThinkPad-P72> <20200218133335.c87d7b2399ee6532bf28b74a@kernel.org> <20200218161231.GD2935@paulmck-ThinkPad-P72> Subject: Re: [PATCH v2 3/9] rcu,tracing: Create trace_rcu_{enter,exit}() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [167.114.26.124] X-Mailer: Zimbra 8.8.15_GA_3899 (ZimbraWebClient - FF72 (Linux)/8.8.15_GA_3895) Thread-Topic: rcu,tracing: Create trace_rcu_{enter,exit}() Thread-Index: E7a9UHyAd+58DcDwrMqxghyBB+Sv3g== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ----- On Feb 18, 2020, at 11:12 AM, paulmck paulmck@kernel.org wrote: > On Tue, Feb 18, 2020 at 01:33:35PM +0900, Masami Hiramatsu wrote: >> On Mon, 17 Feb 2020 08:31:12 -0800 >> "Paul E. McKenney" wrote: >> > >> > > BTW, if you consider the x86 specific code is in the generic file, >> > > we can move NOKPROBE_SYMBOL() in arch/x86/kernel/traps.c. >> > > (Sorry, I've hit this idea right now) >> > >> > Might this affect other architectures with NMIs and probe-like things? >> > If so, it might make sense to leave it where it is. >> >> Yes, git grep shows that arm64 is using rcu_nmi_enter() in >> debug_exception_enter(). >> OK, let's keep it, but maybe it is good to update the comment for >> arm64 too. What about following? >> >> +/* >> + * All functions in do_int3() on x86, do_debug_exception() on arm64 must be >> + * marked NOKPROBE before kprobes handler is called. >> + * ist_enter() on x86 and debug_exception_enter() on arm64 which is called >> + * before kprobes handle happens to call rcu_nmi_enter() which means >> + * that rcu_nmi_enter() must be marked NOKRPOBE. >> + */ > > Would it work to describe the general problem, then give x86 details > as a specific example, as follows? > > /* > * On some architectures, certain exceptions prohibit use of kprobes until > * the exception code path reaches a certain point. For example, on x86 all > * functions called by do_int3() must be marked NOKPROBE. However, once > * kprobe_int3_handler() is called, kprobing is permitted. Specifically, > * ist_enter() is called in do_int3() before kprobe_int3_handle(). > * Furthermore, ist_enter() calls rcu_nmi_enter(), which means that > * rcu_nmi_enter() must be marked NOKRPOBE. > */ > > That way, I don't feel like I need to update the commment each time > a new architecture adds this capability. ;-) I suspect this kind of comment would belong in a new Documentation/features/kprobes/annotations.txt or something similar. You might want to look at other "features" files to see the expected layout. Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com