From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 68712C7618B for ; Wed, 24 Jul 2019 07:39:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3B3412199C for ; Wed, 24 Jul 2019 07:39:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563953962; bh=3OKqgzs2jnudJmaJ1fcYoQAJqJWDM8bUh9bJQ45NSkI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-ID:From; b=CHC8ktl0NIQfy3OhcvtqKnTb33q5X7fKsTWv3UTFCCNO9Hf32mL/c1IQgy3b3DWI+ hXN8t00OfchQS3ugR67HdlJzj9zy1c4Kh9BJHg0z2UPc81kNHLQlcwZ2myo4EyUP0k c3d1lDc8srGUY2cs+l/gVASros2stMhoL3EDfO8g= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726001AbfGXHjV (ORCPT ); Wed, 24 Jul 2019 03:39:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:38706 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725776AbfGXHjU (ORCPT ); Wed, 24 Jul 2019 03:39:20 -0400 Received: from devnote2 (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A905E2190F; Wed, 24 Jul 2019 07:39:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563953959; bh=3OKqgzs2jnudJmaJ1fcYoQAJqJWDM8bUh9bJQ45NSkI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=hA5wQJB8VlSNHaopfRrW7e8DmkAvgmuY5km09VFj+Yq3nKbkU5r4vaq9IyLnNcTim YnSznD43WXE5G8u+azjQMxtazOvFUZud+1Wtv9MKYQ7rIfGTkgRVoqsctKPR55XHyj wPF1nikOuCz6xxX345efpmjyHjkYjNnQBEJciH/g= Date: Wed, 24 Jul 2019 16:39:14 +0900 From: Masami Hiramatsu To: James Morse Cc: Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Naresh Kamboju , Dan Rue , Matt Hart , Anders Roxell , Daniel Diaz Subject: Re: [PATCH v2 2/4] arm64: unwind: Prohibit probing on return_address() Message-Id: <20190724163914.c4a9cea2b5b9df3116e5e694@kernel.org> In-Reply-To: <038c4b88-e7ef-aaab-0a79-5d7371719aa5@arm.com> References: <156378170297.12011.17385386326930403235.stgit@devnote2> <156378172702.12011.1144595747474511323.stgit@devnote2> <038c4b88-e7ef-aaab-0a79-5d7371719aa5@arm.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.32; 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 23 Jul 2019 17:04:21 +0100 James Morse wrote: > Hi, > > On 22/07/2019 08:48, Masami Hiramatsu wrote: > > Prohibit probing on return_address() and subroutines which > > is called from return_address(), since the it is invoked from > > trace_hardirqs_off() which is also kprobe blacklisted. > > (Nits: "which are called" and "since it is") Thanks! > > > > diff --git a/arch/arm64/kernel/return_address.c b/arch/arm64/kernel/return_address.c > > index b21cba90f82d..7f8a143268b0 100644 > > --- a/arch/arm64/kernel/return_address.c > > +++ b/arch/arm64/kernel/return_address.c > > @@ -8,6 +8,7 @@ > > > > #include > > #include > > +#include > > > > #include > > #include > > @@ -17,7 +18,7 @@ struct return_address_data { > > void *addr; > > }; > > > > -static int save_return_addr(struct stackframe *frame, void *d) > > +static nokprobe_inline int save_return_addr(struct stackframe *frame, void *d) > > This nokprobe_inline ends up as __always_inline if kprobes is enabled. > What do we expect the compiler to do with this? save_return_addr is passed as a > function-pointer to walk_stackframe()... I don't see how the compiler can inline it! Oops, that's my mistake. Then it should be NOKPROBE_SYMBOL. > > This would be needed for on_accessible_stack(). > Should we cover ftrace_graph_get_ret_stack()?, or is that already in hand? No, that is OK. It just covers that the functions which are involved in the kprobe execution path. ftrace_graph_ret_stack() is out of the debug exception handler. Thank you, > > { > > struct return_address_data *data = d; > > > > @@ -52,3 +53,4 @@ void *return_address(unsigned int level) > > return NULL; > > } > > EXPORT_SYMBOL_GPL(return_address); > > +NOKPROBE_SYMBOL(return_address); > > > Thanks, > > James -- Masami Hiramatsu From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 29C8CC7618B for ; Wed, 24 Jul 2019 07:39:29 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F22212190F for ; Wed, 24 Jul 2019 07:39:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ALi3+XfL"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="hA5wQJB8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F22212190F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Mime-Version:References:In-Reply-To: Message-Id:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=q/+kWNt9xi0i7f4zvglB5jOnRHvyqmZ4lX5NkbAf4lE=; b=ALi3+XfL2n8z+Z Mc6Hw/IvFvUZ60rTpnTN93/AXDeQbWd661lHmDpMhHp9FpV11vyC97P2kBDgl1VARPSnP5LzDmwoY 8AMXTWGzVd7pWyEgZb9+eiAo7luJ7372KMIsSV78NpRXeDStWvx67mUAOTIDtQpt4l0nlOdmI1FLH N0XuZ8zA6kmXZacymTmQi8lSdOoGDmQqa70F38AFIWlzJneguSOQwDlN4JgXebnIKtSarBFI4jd/b 5cnemXphpkYZvcZ4gFAyHeALBM2jXe2u/+IRtN9yw3Bv1ZGWS8+8PMDtiKmnRVMGLbUF7bqIWZ7XK yN+QfLZ/Yeyg3MvhKQGQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hqBrx-0004ul-Ro; Wed, 24 Jul 2019 07:39:25 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hqBru-0004tw-RV for linux-arm-kernel@lists.infradead.org; Wed, 24 Jul 2019 07:39:24 +0000 Received: from devnote2 (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A905E2190F; Wed, 24 Jul 2019 07:39:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563953959; bh=3OKqgzs2jnudJmaJ1fcYoQAJqJWDM8bUh9bJQ45NSkI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=hA5wQJB8VlSNHaopfRrW7e8DmkAvgmuY5km09VFj+Yq3nKbkU5r4vaq9IyLnNcTim YnSznD43WXE5G8u+azjQMxtazOvFUZud+1Wtv9MKYQ7rIfGTkgRVoqsctKPR55XHyj wPF1nikOuCz6xxX345efpmjyHjkYjNnQBEJciH/g= Date: Wed, 24 Jul 2019 16:39:14 +0900 From: Masami Hiramatsu To: James Morse Subject: Re: [PATCH v2 2/4] arm64: unwind: Prohibit probing on return_address() Message-Id: <20190724163914.c4a9cea2b5b9df3116e5e694@kernel.org> In-Reply-To: <038c4b88-e7ef-aaab-0a79-5d7371719aa5@arm.com> References: <156378170297.12011.17385386326930403235.stgit@devnote2> <156378172702.12011.1144595747474511323.stgit@devnote2> <038c4b88-e7ef-aaab-0a79-5d7371719aa5@arm.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190724_003922_910625_9DDA986F X-CRM114-Status: GOOD ( 18.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dan Rue , Daniel Diaz , Anders Roxell , Catalin Marinas , Naresh Kamboju , Will Deacon , linux-kernel@vger.kernel.org, Matt Hart , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, 23 Jul 2019 17:04:21 +0100 James Morse wrote: > Hi, > > On 22/07/2019 08:48, Masami Hiramatsu wrote: > > Prohibit probing on return_address() and subroutines which > > is called from return_address(), since the it is invoked from > > trace_hardirqs_off() which is also kprobe blacklisted. > > (Nits: "which are called" and "since it is") Thanks! > > > > diff --git a/arch/arm64/kernel/return_address.c b/arch/arm64/kernel/return_address.c > > index b21cba90f82d..7f8a143268b0 100644 > > --- a/arch/arm64/kernel/return_address.c > > +++ b/arch/arm64/kernel/return_address.c > > @@ -8,6 +8,7 @@ > > > > #include > > #include > > +#include > > > > #include > > #include > > @@ -17,7 +18,7 @@ struct return_address_data { > > void *addr; > > }; > > > > -static int save_return_addr(struct stackframe *frame, void *d) > > +static nokprobe_inline int save_return_addr(struct stackframe *frame, void *d) > > This nokprobe_inline ends up as __always_inline if kprobes is enabled. > What do we expect the compiler to do with this? save_return_addr is passed as a > function-pointer to walk_stackframe()... I don't see how the compiler can inline it! Oops, that's my mistake. Then it should be NOKPROBE_SYMBOL. > > This would be needed for on_accessible_stack(). > Should we cover ftrace_graph_get_ret_stack()?, or is that already in hand? No, that is OK. It just covers that the functions which are involved in the kprobe execution path. ftrace_graph_ret_stack() is out of the debug exception handler. Thank you, > > { > > struct return_address_data *data = d; > > > > @@ -52,3 +53,4 @@ void *return_address(unsigned int level) > > return NULL; > > } > > EXPORT_SYMBOL_GPL(return_address); > > +NOKPROBE_SYMBOL(return_address); > > > Thanks, > > James -- Masami Hiramatsu _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel