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=-9.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 8A27BC433DB for ; Mon, 22 Mar 2021 13:06:29 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 3385760238 for ; Mon, 22 Mar 2021 13:06:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3385760238 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+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=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc: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=/5wwom0ZjkF5v6uZzkA0dmUlGTb43pjIvqrMM45HqbQ=; b=FxHW0HwG6Mdp2x/p4PVHELYf5 Luzm4pJQ85fyOhksQzyi/dbj0WLGlAEpYTw3xhI1NqU9LL5rRYFlT0k1I3+XknVkSGxBrL1K8UJml S10aviQ9vZDdTZR2mH1Wq4xKTSGZFy7uGERzNewUtMwsS3hvD3rSX+uHjvEeKtDkE6gDaabWPUlcK Ckdc1BVs1+wiVy6lgIxTbSlsiyzObOFozXsPp9ylEab0CfbJBb4/qkS1mNlromAujKoCnwAAIB8zA u+Oispy1wvcVsPyMY7rifl4jUKarhLGu9e+TdMwj/hloR2j9f3fQPS9SSN+OTvZcSYIE7K0pET3+s IdpRkruFg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lOKER-00BeBJ-AO; Mon, 22 Mar 2021 13:04:33 +0000 Received: from foss.arm.com ([217.140.110.172]) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lOKCP-00Be2b-8h for linux-arm-kernel@lists.infradead.org; Mon, 22 Mar 2021 13:04:27 +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 E2A531042; Mon, 22 Mar 2021 06:02:21 -0700 (PDT) Received: from C02TD0UTHF1T.local (unknown [10.57.23.154]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 607AF3F719; Mon, 22 Mar 2021 06:02:20 -0700 (PDT) Date: Mon, 22 Mar 2021 13:01:58 +0000 From: Mark Rutland To: Catalin Marinas , Will Deacon Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Chen Jun , Marco Elver , Mark Brown Subject: Re: [PATCH] arm64: stacktrace: don't trace arch_stack_walk() Message-ID: <20210322130158.GA78652@C02TD0UTHF1T.local> References: <20210319184106.5688-1-mark.rutland@arm.com> <20210319190205.GI6832@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210319190205.GI6832@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210322_130425_757803_CF177AAA X-CRM114-Status: GOOD ( 19.00 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Mar 19, 2021 at 07:02:06PM +0000, Catalin Marinas wrote: > On Fri, Mar 19, 2021 at 06:41:06PM +0000, Mark Rutland wrote: > > We recently converted arm64 to use arch_stack_walk() in commit: > > > > 5fc57df2f6fd ("arm64: stacktrace: Convert to ARCH_STACKWALK") > > > > The core stacktrace code expects that (when tracing the current task) > > arch_stack_walk() starts a trace at its caller, and does not include > > itself in the trace. However, arm64's arch_stack_walk() includes itself, > > and so traces include one more entry than callers expect. The core > > stacktrace code which calls arch_stack_walk() tries to skip a number of > > entries to prevent itself appearing in a trace, and the additional entry > > prevents skipping one of the core stacktrace functions, leaving this in > > the trace unexpectedly. > > > > We can fix this by having arm64's arch_stack_walk() begin the trace with > > its caller. The first value returned by the trace will be > > __builtin_return_address(0), i.e. the caller of arch_stack_walk(). The > > first frame record to be unwound will be __builtin_frame_address(1), > > i.e. the caller's frame record. To prevent surprises, arch_stack_walk() > > is also marked noinline. [...] > > Fixes: 5fc57df2f6fd ("arm64: stacktrace: Convert to ARCH_STACKWALK") > > Signed-off-by: Mark Rutland > > Cc: Catalin Marinas > > Cc: Chen Jun > > Cc: Marco Elver > > Cc: Mark Brown > > Cc: Will Deacon > > Thanks Mark. I think we should add a cc stable, just with Fixes doesn't > always seem to end up in a stable kernel: > > Cc: # 5.10.x Makes sense to me, sure. > With that: > > Reviewed-by: Catalin Marinas Thanks! Will, I assume you're happy to fold in the above when picking this. If you'd prefer I repost with that folded in, please let me know! Mark. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel