Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm64: stacktrace: Clarify documentation of EL0 entry frame skipping
@ 2020-10-07 17:11 Mark Brown
  2020-10-08 10:15 ` Mark Rutland
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Brown @ 2020-10-07 17:11 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon; +Cc: Mark Rutland, Mark Brown, linux-arm-kernel

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@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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-10-08 11:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-07 17:11 [PATCH] arm64: stacktrace: Clarify documentation of EL0 entry frame skipping Mark Brown
2020-10-08 10:15 ` Mark Rutland
2020-10-08 11:14   ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox