Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2073362lqz; Tue, 2 Apr 2024 06:39:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU8R1R6KuGPD2Oj5yfKD1cdk3pFWjotmwQnzQ9mYp8lMXhyRIjp0KT08i0ZBFNi1qzqZMjb8xVQHyDFz76X75GzhlMggOjNHGXaUfRvzQ== X-Google-Smtp-Source: AGHT+IGfWSbbj2396tzLWYWvTQ7snwgeaN4knHijck4bvBSr9MR8RBbfeSl082VPm80Qyeu2Bl1c X-Received: by 2002:a05:6358:52c1:b0:17f:8726:61db with SMTP id z1-20020a05635852c100b0017f872661dbmr14586615rwz.3.1712065189613; Tue, 02 Apr 2024 06:39:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712065189; cv=pass; d=google.com; s=arc-20160816; b=ZK1sRrJHs6JjKcR+6BCQJET+UWhFpYgb9whmISp7Ybi/mBGNuxtwIuOyKdp8TlrRMr VjPkeTXNEhslV0C2/wMcvIVJTMyDwZ9SjYrPJarXTGkQHQGOzwIio+WGpRAQbdWHE0rl 2PrJqWxA5KDtdolDDgIycUDinZJKAb/V0acUo4meKQMgWEaYbeERN2Pr+pSMp2pgAYQL SN0bRYPERs0bHCCvYNEJtH62p1qcQiijEDpKprkQxgTIOzBWef8MY4V9fVbB0KAHGbnJ /Udbt7oGPQYiweGr9w+dJwL65xo95abR7V/RINWxGiul3AhmdbOYz7ZDnRond9UPkwbl 3GPg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=jY5//6Du2pTQZWVH0jCz+G3qgjlZ0vRTRA6F/N21xAM=; fh=ATlQKU0OtD3nSxm1+UNPgFmqz72BHKUX/W+ZlbqL0+0=; b=s9X+3JNmfDrfAAlddUxDBGda5nMapCcENOJmL7SUmxlPflb7Xgamari64I0R3p/Pkq WKnxp91iRf4kdKei0IvdosM6wr0h2b3l18WP/RxRdI4W00btxJAX3sdoBpeQev4V256t W2Lz7LHem7bls3hWWAy56ah7ontMMkAkqBarkoNXEKwkd3I2g4qPfjjauQC9fvgeem5L S0ng0eHLLJ9UiPEgliQpLZSs8WvvRKwPB+kpABRDq8SbtiiDbKGVILE2gt61lffVa7ZC 7DSwGkJF/QD9Own28NFxcAT8BTjajgk97RsKSv4HUH06mYrov6JcT/ZLB2lMdSCsf0DO rbnQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=D08TMqDU; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-128025-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-128025-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id n2-20020a6563c2000000b005dc8a33fcc3si11650639pgv.653.2024.04.02.06.39.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 06:39:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-128025-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=D08TMqDU; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-128025-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-128025-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 91BA62833C7 for ; Tue, 2 Apr 2024 13:18:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4414B81752; Tue, 2 Apr 2024 13:18:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="D08TMqDU" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5958360279 for ; Tue, 2 Apr 2024 13:18:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712063932; cv=none; b=rC19hskMI/t4CtW8yXQpQ8eNS2rXPqLYMWcEo13DCkbQ93Ut/QPJk2Kk1rgt0+Wo9fWzNTuf8rAh6NXVuiK5c9ayl7xKT1qBF3zpyX7wKu0lTaLm53Hz15wbv6N41cI0tyMv84rggUtVyQEszlY5IzcQweE4zWk4N4YO3+ma744= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712063932; c=relaxed/simple; bh=jY5//6Du2pTQZWVH0jCz+G3qgjlZ0vRTRA6F/N21xAM=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=gP/d1Jp7Yu62SSW31gSy7xYOq+InCjvro8sz680lHtP8fwDfbt4uTQZH8I9BdXRmVMaxuJpJsB58S1/efCK+vpiyg5SH9r/PVOvBJr+6NG/uvpv2qaYgWYL92SSOkNyBksUEyOno/xcJBNfdMiY8NgBj2cbBFcTPRqYTzsHc0XM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=D08TMqDU; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6CD3AC433C7; Tue, 2 Apr 2024 13:18:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712063931; bh=jY5//6Du2pTQZWVH0jCz+G3qgjlZ0vRTRA6F/N21xAM=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=D08TMqDUO1xmdZLn0nLYMEK8EgL9/rQL8jEl4BTnp/+gVup8uwgXxf/ETYwvAgI+Q etNe0s3f89IhcfIKmeMWRzp6/2abfxbPl/FaJleloRAKL7T+JglpnfBKU73niCkGTD Ihbs9OYCfoeuiQw/Ax+4u5v2ZEZbwS2u9uQSrtwaBBNo+s7vEKV+feON4LMc1q+bc/ A0daqzNqniOz4/W9n9XRIwPbOKoY+3/BgUyJmIg8oqqMZ9oKLrbEK+jhE+KgoVg/k5 9EWrkV1EltuC/tWXdH5gJd+E5kLa5VGUbk+AtART1SdurDWUQFt7hTvN/YLEZJYN0Y raHLfffNDDuoA== From: =?utf-8?B?QmrDtnJuIFTDtnBlbA==?= To: Puranjay Mohan , Paul Walmsley , Palmer Dabbelt , Albert Ou , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, =?utf-8?B?QmrDtnJuIFTDtnBlbA==?= Cc: puranjay12@gmail.com Subject: Re: [PATCH 0/2] riscv: ftrace: make stack walk more robust. In-Reply-To: <20240328184020.34278-1-puranjay12@gmail.com> References: <20240328184020.34278-1-puranjay12@gmail.com> Date: Tue, 02 Apr 2024 15:18:48 +0200 Message-ID: <8734s3sy13.fsf@all.your.base.are.belong.to.us> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Puranjay Mohan writes: > The current stack walker in riscv implemented in walk_stackframe() provid= es > the PC to a callback function when it unwinds the stacks. This doesn't > allow implementing stack walkers that need access to more information like > the frame pointer, etc. > > This series makes walk_stackframe() provide a unwinde_state structure to > callback functions. This structure has all the information that > walk_stackframe() can provide. > > Currently, there are four users of walk_stackframe(): return_address(), > perf_callchain_kernel(), dump_backtrace(), and __get_wchan(). All of these > have been converted to use arch_stack_walk() rather than calling > walk_stackframe() directly. > > We need this to implement arch_bpf_stack_walk() that provides a callback > that needs the FP, SP, and PC. This will be needed for implementing BFP > exceptions for RISCV. Hmm, I wonder if it's easier to have these two patches as part of the BPF exception series, instead of having the dependencies be cross-tree? > There are no functional changes in this series. > > I have tested this by crashing the kernel and looking at the stack trace > with and without CONFIG_FRAME_POINTER I have two really minor style nits, but regardless if they're fixed or not: Reviewed-by: Bj=C3=B6rn T=C3=B6pel