[PATCH] arm64: stacktrace: Clarify documentation of EL0 entry frame skipping

Mark Brown broonie at kernel.org
Wed Oct 7 13:11:38 EDT 2020


The unwinder suppresses reporting of frames created on entry from EL0 where
both FP and PC are NULL in order to avoid having the final NULL PC
cluttering traces and potentially creating confusion. There is a comment
explaining this which doesn't explicitly call out the case where we have
a valid PC but NULL FP, do so in order to ensure that things are as
clear as possible to readers unfamiliar with the code.

Signed-off-by: Mark Brown <broonie at kernel.org>
---
 arch/arm64/kernel/stacktrace.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/kernel/stacktrace.c b/arch/arm64/kernel/stacktrace.c
index fa56af1a59c3..0c474d81d4e9 100644
--- a/arch/arm64/kernel/stacktrace.c
+++ b/arch/arm64/kernel/stacktrace.c
@@ -107,8 +107,9 @@ int notrace unwind_frame(struct task_struct *tsk, struct stackframe *frame)
 	/*
 	 * Frames created upon entry from EL0 have NULL FP and PC values, so
 	 * don't bother reporting these. Frames created by __noreturn functions
-	 * might have a valid FP even if PC is bogus, so only terminate where
-	 * both are NULL.
+	 * might have a valid FP even if PC is bogus and the last frame in a
+	 * normal stack will have a valid PC but NULL FP, so only terminate
+	 * early where both are NULL.
 	 */
 	if (!frame->fp && !frame->pc)
 		return -EINVAL;
-- 
2.20.1




More information about the linux-arm-kernel mailing list