public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: jpoimboe@redhat.com (Josh Poimboeuf)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 3/3] arm64: reliable stacktraces
Date: Fri, 26 Oct 2018 10:37:04 -0500	[thread overview]
Message-ID: <20181026153704.7g34j3gtlklepyvb@treble> (raw)
In-Reply-To: <20181026142157.B8FAA68C97@newverein.lst.de>

On Fri, Oct 26, 2018 at 04:21:57PM +0200, Torsten Duwe wrote:
> Enhance the stack unwinder so that it reports whether it had to stop
> normally or due to an error condition; unwind_frame() will report
> continue/error/normal ending and walk_stackframe() will pass that
> info. __save_stack_trace() is used to check the validity of a stack;
> save_stack_trace_tsk_reliable() can now trivially be implemented.
> Modify arch/arm64/kernel/time.c as the only external caller so far
> to recognise the new semantics.
> 
> I had to introduce a marker symbol kthread_return_to_user to tell
> the normal origin of a kernel thread.
> 
> Signed-off-by: Torsten Duwe <duwe@suse.de>

I haven't looked at the code, but the commit log doesn't inspire much
confidence.  It's missing everything I previously asked for in the
powerpc version.

There's zero mention of objtool.  What analysis was done to indicate
that we can rely on frame pointers?

Such a frame pointer analysis should be included in the commit log.  It
should describe *at least* the following:

- whether inline asm statements with call/branch instructions will
  confuse GCC into skipping the frame pointer setup if it considers the
  function to be a leaf function;

- whether hand-coded non-leaf assembly functions can accidentally omit
  the frame pointer prologue setup;

- whether GCC can generally be relied upon to get arm64 frame pointers
  right, in both normal operation and edge cases.


The commit log should also describe whether the unwinder itself can be
considered reliable for all edge cases:

- detection and reporting of preemption and page faults;

- detection and recovery from function graph tracing;

- detection and reporting of other unexpected conditions,
  including when the unwinder doesn't reach the end of the stack.

-- 
Josh

  reply	other threads:[~2018-10-26 15:37 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-26 14:20 [PATCH v4 0/3] arm64 live patching Torsten Duwe
2018-10-26 14:21 ` [PATCH v4 1/3] arm64: implement ftrace with regs Torsten Duwe
2018-10-31 12:10   ` Mark Rutland
2018-10-31 13:19     ` Jiri Kosina
2018-10-31 14:18       ` Mark Rutland
2018-10-31 17:58         ` Torsten Duwe
2018-11-08 12:12   ` Ard Biesheuvel
2018-11-12 11:51     ` Torsten Duwe
2018-10-26 14:21 ` [PATCH v4 2/3] arm64: implement live patching Torsten Duwe
2018-11-06 16:49   ` Miroslav Benes
2018-11-08 12:42   ` Ard Biesheuvel
2018-11-12 11:01     ` Torsten Duwe
2018-11-12 11:06       ` Ard Biesheuvel
2018-10-26 14:21 ` [PATCH v4 3/3] arm64: reliable stacktraces Torsten Duwe
2018-10-26 15:37   ` Josh Poimboeuf [this message]
2018-10-29  9:28     ` Mark Rutland
2018-10-29 15:42       ` Josh Poimboeuf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181026153704.7g34j3gtlklepyvb@treble \
    --to=jpoimboe@redhat.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox