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 9653513D896; Tue, 23 Jul 2024 18:43:39 +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=1721760219; cv=none; b=VDJ01hUVBU1x+Y00W4dZpVRVdQ3aQLss8f37pRv6HBfvcCQ+W3oVJW0JEC1SoIWUwQLYX/VNcYiOTXkLGSgkKc0ScWvwCkLp3W9T4cs+wBc7MqYXzEhKZ//BUqGJMuV/V9orZKKwD9sriP+dV2Kq/e0GV8p0mv5wXNSFn1p3RIQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721760219; c=relaxed/simple; bh=8H7mSN8x085vq+Ek2PZP388bJHoQxyuzoE4yPj8hsIw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IDW4NJvq2cOEtdfjvlo2LV/xB7WAx5y/YpRW01ocse+y30pfAH0pzFnV8adjcS8+/sb/lZL9RldXEv4NPKAf7+LrAlTsUA9OOZI0yr82Ja0hqTGwhgDBCqD367i2XLXNoB2KbSz9D4jEztpR3V7xIbNPjQGuB+sc68PT1ISiCwE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=RQtlMh2O; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="RQtlMh2O" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1AE40C4AF09; Tue, 23 Jul 2024 18:43:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1721760219; bh=8H7mSN8x085vq+Ek2PZP388bJHoQxyuzoE4yPj8hsIw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RQtlMh2OIPaEuD9JEwD2K+aQxZLeMBnlq03aCqxHW2W1ErAIafsUMC13AfxIq32A7 peQX23usx9xM9OlqEGaeOFdatq1YocQ2HWq408VsH6Bb6czYDTluubz2xXorXCfSq5 Ghpn1kbWl5dGolkxFa2UhI/j0OqSt4iSjRfGTtoc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Puranjay Mohan , "Steven Rostedt (Google)" , Palmer Dabbelt , Sasha Levin Subject: [PATCH 6.9 143/163] riscv: stacktrace: fix usage of ftrace_graph_ret_addr() Date: Tue, 23 Jul 2024 20:24:32 +0200 Message-ID: <20240723180148.997680334@linuxfoundation.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240723180143.461739294@linuxfoundation.org> References: <20240723180143.461739294@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Puranjay Mohan [ Upstream commit 393da6cbb2ff89aadc47683a85269f913aa1c139 ] ftrace_graph_ret_addr() takes an `idx` integer pointer that is used to optimize the stack unwinding. Pass it a valid pointer to utilize the optimizations that might be available in the future. The commit is making riscv's usage of ftrace_graph_ret_addr() match x86_64. Signed-off-by: Puranjay Mohan Reviewed-by: Steven Rostedt (Google) Link: https://lore.kernel.org/r/20240618145820.62112-1-puranjay@kernel.org Signed-off-by: Palmer Dabbelt Signed-off-by: Sasha Levin --- arch/riscv/kernel/stacktrace.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/riscv/kernel/stacktrace.c b/arch/riscv/kernel/stacktrace.c index 0d3f00eb0baee..10e311b2759d3 100644 --- a/arch/riscv/kernel/stacktrace.c +++ b/arch/riscv/kernel/stacktrace.c @@ -32,6 +32,7 @@ void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs, bool (*fn)(void *, unsigned long), void *arg) { unsigned long fp, sp, pc; + int graph_idx = 0; int level = 0; if (regs) { @@ -68,7 +69,7 @@ void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs, pc = regs->ra; } else { fp = frame->fp; - pc = ftrace_graph_ret_addr(current, NULL, frame->ra, + pc = ftrace_graph_ret_addr(current, &graph_idx, frame->ra, &frame->ra); if (pc == (unsigned long)ret_from_exception) { if (unlikely(!__kernel_text_address(pc) || !fn(arg, pc))) -- 2.43.0