linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Josh Poimboeuf <jpoimboe@redhat.com>
To: "Madhavan T. Venkataraman" <madvenka@linux.microsoft.com>
Cc: Mark Brown <broonie@kernel.org>,
	mark.rutland@arm.com, ardb@kernel.org, jthierry@redhat.com,
	catalin.marinas@arm.com, will@kernel.org, jmorris@namei.org,
	pasha.tatashin@soleen.com, linux-arm-kernel@lists.infradead.org,
	live-patching@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH v4 1/2] arm64: Introduce stack trace reliability checks in the unwinder
Date: Fri, 21 May 2021 15:08:06 -0500	[thread overview]
Message-ID: <20210521200806.nk3m7aldelmi3l2r@treble> (raw)
In-Reply-To: <bf3a5289-8199-b665-0327-ed8240dd7827@linux.microsoft.com>

On Fri, May 21, 2021 at 02:41:56PM -0500, Madhavan T. Venkataraman wrote:
> > Or is frame->reliable supposed to be checked after all?  Looking at the
> > code again, I'm not sure.
> > 
> > Either way it would be good to document the interface more clearly in a
> > comment above the function.
> > 
> 
> So, arch_stack_walk_reliable() would do this:
> 
> 	start_backtrace(frame);
> 
> 	while (...) {
> 		if (!frame->reliable)
> 			return error;
> 
> 		consume_entry(...);
> 
> 		ret = unwind_frame(...);
> 
> 		if (ret)
> 			break;
> 	}
> 
> 	if (ret == -ENOENT)
> 		return success;
> 	return error;
> 
> 
> Something like that.

I see.  So basically there are six possible combinations of return
states:

  1) No error		frame->reliable
  2) No error		!frame->reliable
  3) -ENOENT		frame->reliable
  5) -ENOENT		!frame->reliable (doesn't happen in practice)
  4) Other error	frame->reliable  (doesn't happen in practice)
  6) Other error	!frame->reliable


On x86 we have fewer combinations:

  1) No error		state->error
  2) No error		!state->error
  3) Error		state->error
  4) Error		!state->error (doesn't happen in practice)


I think the x86 interface seems more robust, because it's more narrow
and has fewer edge cases.  Also it doesn't have to distinguish between
error enums, which can get hairy if a downstream callee happens to
return -ENOENT for a different reason.

-- 
Josh


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

  reply	other threads:[~2021-05-21 20:10 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <68eeda61b3e9579d65698a884b26c8632025e503>
2021-05-16  4:00 ` [RFC PATCH v4 0/2] arm64: Stack " madvenka
2021-05-16  4:00   ` [RFC PATCH v4 1/2] arm64: Introduce stack " madvenka
2021-05-21 16:11     ` Mark Brown
2021-05-21 17:23       ` Madhavan T. Venkataraman
2021-05-21 17:42         ` Mark Brown
2021-05-21 17:47           ` Madhavan T. Venkataraman
2021-05-21 17:53             ` Mark Brown
2021-05-21 18:48               ` Josh Poimboeuf
2021-05-21 18:59                 ` Madhavan T. Venkataraman
2021-05-21 19:11                   ` Josh Poimboeuf
2021-05-21 19:16                     ` Josh Poimboeuf
2021-05-21 19:41                       ` Madhavan T. Venkataraman
2021-05-21 20:08                         ` Josh Poimboeuf [this message]
2021-05-25 21:44               ` Madhavan T. Venkataraman
2021-05-16  4:00   ` [RFC PATCH v4 2/2] arm64: Create a list of SYM_CODE functions, blacklist them " madvenka
2021-05-19  2:06     ` nobuta.keiya
2021-05-19  3:38       ` Madhavan T. Venkataraman
2021-05-19 19:27     ` Mark Brown
2021-05-20  2:00       ` Madhavan T. Venkataraman
2021-05-21 17:18   ` [RFC PATCH v4 0/2] arm64: Stack trace reliability checks " Mark Brown
2021-05-21 17:32     ` Madhavan T. Venkataraman
2021-05-21 17:47       ` Mark Brown
2021-05-21 17:48         ` Madhavan T. Venkataraman

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=20210521200806.nk3m7aldelmi3l2r@treble \
    --to=jpoimboe@redhat.com \
    --cc=ardb@kernel.org \
    --cc=broonie@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=jmorris@namei.org \
    --cc=jthierry@redhat.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=live-patching@vger.kernel.org \
    --cc=madvenka@linux.microsoft.com \
    --cc=mark.rutland@arm.com \
    --cc=pasha.tatashin@soleen.com \
    --cc=will@kernel.org \
    --subject='Re: [RFC PATCH v4 1/2] arm64: Introduce stack trace reliability checks in the unwinder' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).