Skip to contentSkip to conversation

FAILED: patch "[PATCH] riscv: stacktrace: Fixup ftrace_graph_ret_addr retp argument" failed to apply to 5.10-stable tree

PATCH [email protected] 1 participant 1 message Jan 4, 2023

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 5.10-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

Possible dependencies:

5c3022e4a616 ("riscv: stacktrace: Fixup ftrace_graph_ret_addr retp argument") f766f77a74f5 ("riscv/stacktrace: Fix stack output without ra on the stack top")

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 5c3022e4a616d800cf5f4c3a981d7992179e44a1 Mon Sep 17 00:00:00 2001
From: Guo Ren <[email protected]>
Date: Wed, 9 Nov 2022 01:49:36 -0500
Subject: [PATCH] riscv: stacktrace: Fixup ftrace_graph_ret_addr retp argument

The 'retp' is a pointer to the return address on the stack, so we must pass the current return address pointer as the 'retp' argument to ftrace_push_return_trace(). Not parent function's return address on the stack.

Fixes b785ec129bd9 ("riscv/ftrace: Add HAVE_FUNCTION_GRAPH_RET_ADDR_PTR support")
arch/riscv/kernel/stacktrace.c +1 -1
index 08d11a53f39e..bcfe9eb55f80 100644
@@ -58,7 +58,7 @@ void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs,
 		} else {
 			fp = frame->fp;
 			pc = ftrace_graph_ret_addr(current, NULL, frame->ra,
-						   (unsigned long *)(fp - 8));
+						   &frame->ra);
 		}
 
 	}