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=-5.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 874F3C7618B for ; Tue, 23 Jul 2019 16:04:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 68C702239E for ; Tue, 23 Jul 2019 16:04:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388752AbfGWQEc (ORCPT ); Tue, 23 Jul 2019 12:04:32 -0400 Received: from foss.arm.com ([217.140.110.172]:57036 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727398AbfGWQEc (ORCPT ); Tue, 23 Jul 2019 12:04:32 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9540328; Tue, 23 Jul 2019 09:04:31 -0700 (PDT) Received: from [10.1.196.105] (eglon.cambridge.arm.com [10.1.196.105]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5DE083F71A; Tue, 23 Jul 2019 09:04:26 -0700 (PDT) Subject: Re: [PATCH v2 2/4] arm64: unwind: Prohibit probing on return_address() To: Masami Hiramatsu 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 References: <156378170297.12011.17385386326930403235.stgit@devnote2> <156378172702.12011.1144595747474511323.stgit@devnote2> From: James Morse Message-ID: <038c4b88-e7ef-aaab-0a79-5d7371719aa5@arm.com> Date: Tue, 23 Jul 2019 17:04:21 +0100 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <156378172702.12011.1144595747474511323.stgit@devnote2> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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") > 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! This would be needed for on_accessible_stack(). Should we cover ftrace_graph_get_ret_stack()?, or is that already in hand? > { > 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 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=-5.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 24CECC7618B for ; Tue, 23 Jul 2019 16:04:38 +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 EE44D223BA for ; Tue, 23 Jul 2019 16:04:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ay/UzH2x" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EE44D223BA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com 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:In-Reply-To:MIME-Version:Date: Message-ID:From:References:To:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=DsngU0V4vK7K/CpUkeS016+0xm8cEKIRyU+LPTBUOe0=; b=ay/UzH2xLbBIoX qcwcB3RaBTb/iulbFDpgOKS/4RGX6fsUM2W/YrSVEI0m37wicsdCZjf4EiTxn7fWPblFqtwxhsQzN es0fCqNkJkLzHOj/boNlMDYZqrtYCfhbrEwS/p6ZVF5i7XlhUSgNAx4mtpB4plYnIEOWB0meBbrTt AOzPWBMUwaFjHVYe9ZFcd2A7qDYOTOm3LHwZdlwcK+mGRq1CVMi0dxaFjhGCXmieD/NvxGHsZpxf7 WfJcARYDgD/lu9fUribtKrp6zQzZNwDnjJgh6njDZepIvTJ8RoC9VHgPbFZx8z36dMLSGaevGrpwW LrClslOD+qpYQMKOOIYw==; 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 1hpxHH-00048L-0G; Tue, 23 Jul 2019 16:04:35 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hpxHD-00047q-Vy for linux-arm-kernel@lists.infradead.org; Tue, 23 Jul 2019 16:04:33 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9540328; Tue, 23 Jul 2019 09:04:31 -0700 (PDT) Received: from [10.1.196.105] (eglon.cambridge.arm.com [10.1.196.105]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5DE083F71A; Tue, 23 Jul 2019 09:04:26 -0700 (PDT) Subject: Re: [PATCH v2 2/4] arm64: unwind: Prohibit probing on return_address() To: Masami Hiramatsu References: <156378170297.12011.17385386326930403235.stgit@devnote2> <156378172702.12011.1144595747474511323.stgit@devnote2> From: James Morse Message-ID: <038c4b88-e7ef-aaab-0a79-5d7371719aa5@arm.com> Date: Tue, 23 Jul 2019 17:04:21 +0100 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <156378172702.12011.1144595747474511323.stgit@devnote2> Content-Language: en-GB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190723_090432_069269_E36753CE X-CRM114-Status: GOOD ( 15.69 ) 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 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") > 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! This would be needed for on_accessible_stack(). Should we cover ftrace_graph_get_ret_stack()?, or is that already in hand? > { > 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel