All of lore.kernel.org
 help / color / mirror / Atom feed
From: Josh Poimboeuf <jpoimboe@kernel.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Mark Rutland <mark.rutland@arm.com>,
	Miroslav Benes <mbenes@suse.cz>,
	jikos@kernel.org, pmladek@suse.com, joe.lawrence@redhat.com,
	nstange@suse.de, mpdesouza@suse.de, broonie@kernel.org,
	live-patching@vger.kernel.org,
	Nick Desaulniers <ndesaulniers@google.com>,
	"Jose E. Marchesi" <jose.marchesi@oracle.com>,
	Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Subject: Re: Live Patching Microconference at Linux Plumbers
Date: Fri, 14 Apr 2023 21:39:49 -0700	[thread overview]
Message-ID: <20230415043949.7y4tvshe26zday3e@treble> (raw)
In-Reply-To: <20230414193013.GB778423@hirez.programming.kicks-ass.net>

On Fri, Apr 14, 2023 at 09:30:13PM +0200, Peter Zijlstra wrote:
> On Fri, Apr 14, 2023 at 10:12:55AM -0700, Josh Poimboeuf wrote:
> 
> > > * How to avoid/minimize the need to reverse-engineer control flow for things
> > >   like ORC generation.
> > > 
> > >   On the arm64 side we're pretty averse to doing this to generate metadata for
> > >   unwinding (and we might not need to), but there are things objtool does today
> > >   that requires awareness of control-flow (e.g. forward-edge checks for noinstr
> > >   safety).
> > > 
> > >   Hopefully without a flamewar about DWARF...
> > 
> > If objtool is going to be doing control-flow anyway then it could just
> > validate DWARF/SFrame.  Then everybody's happy?
> 
> Right; so per another recent thread somewhere; you can't rely on
> DWARF/Sframe or any other compiler generated thing simply because it
> doesn't cover .S files and inline asm -- and this being a kernel, we've
> got quite a bit of that.
> 
> At best it could use DWARF to help reconstruct code flow and then
> validate Sframe for the bits that got sframe.

I wasn't (necessarily) suggesting that objtool use DWARF as an input to
help it construct the control-flow graph (CFG).

Instead, the idea is for objtool to continue to reverse-engineer the CFG
as it does today (albeit with a little help from the compiler in
specific problematic areas, e.g. noreturns and jump tables).

Then, it could use that independently-developed CFG to read the
compiler-generated metadata (DWARF/SFrame/whatever), and report any
warnings if the DWARF doesn't match objtool's CFG.

In other words, DWARF validation becomes just another optional objtool
feature, similar to its other unwinding-related features like frame
pointer validation and ORC generation.

That way, regardless of which philosophy [1] you subscribe to, if
something is amiss with reliable unwinding, the end result is the same:
a warning.

Then a human can look at the warning and investigate whether it's
objtool or DWARF/whatever that needs to be fixed.

[1] "reverse engineering is risky" vs "reverse engineering is reliable"

-- 
Josh

  reply	other threads:[~2023-04-15  4:39 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-29 12:05 Live Patching Microconference at Linux Plumbers Miroslav Benes
2023-03-29 16:28 ` Joe Lawrence
2023-04-14  9:11 ` Miroslav Benes
2023-04-14  9:53 ` Mark Rutland
2023-04-14 12:54   ` Jose E. Marchesi
2023-04-14 13:51     ` Miguel Ojeda
2023-04-14 14:34       ` Jose E. Marchesi
2023-04-14 14:14     ` Miroslav Benes
2023-04-14 17:12   ` Josh Poimboeuf
2023-04-14 19:04     ` Miguel Ojeda
2023-04-14 20:22       ` Arnaldo Carvalho de Melo
2023-04-14 20:29         ` Miguel Ojeda
2023-04-14 21:10       ` Josh Poimboeuf
2023-04-14 19:30     ` Peter Zijlstra
2023-04-15  4:39       ` Josh Poimboeuf [this message]
2023-04-17  7:48         ` Peter Zijlstra
2023-04-17  8:58     ` Mark Rutland
2023-04-18  3:53   ` James Morris
2023-05-03 20:05   ` Joe Lawrence
2023-05-03 20:33     ` Steven Rostedt
2023-05-22 18:41 ` Joe Lawrence

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=20230415043949.7y4tvshe26zday3e@treble \
    --to=jpoimboe@kernel.org \
    --cc=broonie@kernel.org \
    --cc=jikos@kernel.org \
    --cc=joe.lawrence@redhat.com \
    --cc=jose.marchesi@oracle.com \
    --cc=live-patching@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mbenes@suse.cz \
    --cc=miguel.ojeda.sandonis@gmail.com \
    --cc=mpdesouza@suse.de \
    --cc=ndesaulniers@google.com \
    --cc=nstange@suse.de \
    --cc=peterz@infradead.org \
    --cc=pmladek@suse.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.