From mboxrd@z Thu Jan 1 00:00:00 1970 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 0294D1EEA3C for ; Thu, 14 May 2026 02:15:25 +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=1778724926; cv=none; b=d8vP41nV228MJOBcf+IXkRkXqb4QfSa14YaA1zs/cmiBHgetro9Kt2u9oot6wxWpb28rkk/NMkN4iruMNCNwHRRP6HPaReJWiJAxN63zbARhF9QN+MLywk6vDX7HPtsO7tSJkP7Q21xaJQbJlxz1xAVqy5AawFASwAbmpJKJuC0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778724926; c=relaxed/simple; bh=gufw34IuiHNiE+ByypQKYUWNSB1gfIHap088tcTp+/I=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=uFd4ImJ+y0YDc0UZpqnc3bbmD5Fgvk1BzjhPHTJ/JtvX2mfZfid+93xY1fDg1sOzpzvQ+pXAcGm3ag+IkIMiTBV6fys9PbEztXA3zE/bHDEbHTRuTRtPPEhpv6MVjTCFKSvHTQQXzCsSHNZPhtGJx+/Mshvbss7iNTcde1w4Hfk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Q3tbrMmX; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Q3tbrMmX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 16395C19425; Thu, 14 May 2026 02:15:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1778724925; bh=gufw34IuiHNiE+ByypQKYUWNSB1gfIHap088tcTp+/I=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=Q3tbrMmXdA0fUHqsmllTj8EmxJ27S+UxQYlYEeThzfm0XMFsZFmyi25c8QOK2QFIV FIKB6yecWqunCAgoE2y0x1HaO55u5k1o72Fd8JFRRfeWaB7+OfxI0XMa0qU2ME2Ot3 0rQyYVY259k7GBZ/xJ7GS0xnrf3Xar+k6DmgvngTe5089gYAwJdjktMUAgQAoO4zJF t7iHdgJ8t+0TXMmQbSXeVB71OcKK8rfUq5Ulyhi+NmGJXIg3enwEXaX0M6QQn7G6t2 GhbkAYW+jk6CgQg/rvPEOzssr/tSViJ7m6Azmq7LQGHddbKJf1gxdI9jgPYl13c1nM +/3HccTLfSJTQ== Date: Wed, 13 May 2026 20:15:24 -0600 (MDT) From: Paul Walmsley To: Rui Qi cc: pjw@kernel.org, palmer@dabbelt.com, aou@eecs.berkeley.edu, alex@ghiti.fr, zhangchunyan@iscas.ac.cn, xujiakai2025@iscas.ac.cn, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] riscv: Fix ftrace_graph_ret_addr() to use the correct task pointer In-Reply-To: <20260408092915.46408-1-qirui.001@bytedance.com> Message-ID: References: <20260408092915.46408-1-qirui.001@bytedance.com> 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=US-ASCII On Wed, 8 Apr 2026, Rui Qi wrote: > The walk_stackframe() function is used to unwind the stack of a given > task. When function graph tracing is enabled, ftrace_graph_ret_addr() > is called to resolve the original return address if it was modified by > the tracer. > > The current code incorrectly passes 'current' instead of 'task' to > ftrace_graph_ret_addr(). This causes incorrect return address resolution > when unwinding a stack of a different task (e.g., when the task is > blocked in __switch_to). > > Fix this by passing 'task' instead of 'current' to match the behavior > of other architectures (arm64, loongarch, powerpc, s390, x86). > > Signed-off-by: Rui Qi Thanks, queued for v7.1-rc. - Paul