[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200324221109.GU2452@worktop.programming.kicks-ass.net>
Date: Tue, 24 Mar 2020 23:11:09 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Josh Poimboeuf <jpoimboe@...hat.com>
Cc: tglx@...utronix.de, linux-kernel@...r.kernel.org, x86@...nel.org,
mhiramat@...nel.org, mbenes@...e.cz, brgerst@...il.com
Subject: Re: [PATCH v3 18/26] objtool: Fix !CFI insn_state propagation
On Tue, Mar 24, 2020 at 04:40:06PM -0500, Josh Poimboeuf wrote:
> On Tue, Mar 24, 2020 at 04:31:31PM +0100, Peter Zijlstra wrote:
> > + if (!save_insn->visited) {
> > + /*
> > + * Oops, no state to copy yet.
> > + * Hopefully we can reach this
> > + * instruction from another branch
> > + * after the save insn has been
> > + * visited.
> > + */
> > + if (insn == first)
> > + return 0; // XXX
>
> Yeah, moving this code out to apply_insn_hint() seems like a nice idea,
> but it wouldn't be worth it if it breaks this case. TBH I don't
> remember if this check was for a real-world case. Might be worth
> looking at... If this case doesn't exist in reality then we could just
> remove this check altogether.
I'll go run a bunch of builds with a print on it, that should tell us I
suppose.
> > +
> > + WARN_FUNC("objtool isn't smart enough to handle this CFI save/restore combo",
> > + sec, insn->offset);
> > + return 1;
> > + }
> > +
> > + insn->state = save_insn->state;
> > + }
> > +
> > + *state = insn->state;
>
> This would have been easier to review if apply_insn_hint() were added in
> a separate patch.
27 it will be!
> > +
> > + /* restore !CFI state */
> > + state->df = old.df;
> > + state->uaccess = old.uaccess;
> > + state->uaccess_stack = old.uaccess_stack;
>
> Maybe we should just move the CFI stuff into a state->cfi substruct.
> That would remove the need for these bits and probably also the comment
> above the insn_state declaration.
Indeed!
Powered by blists - more mailing lists