Re: [RFC][PATCH 6/6] objtool,x86: Rewrite retpoline thunk calls

From: Peter Zijlstra
Date: Sat Feb 20 2021 - 11:49:53 EST


On Sat, Feb 20, 2021 at 01:39:20AM +0100, Borislav Petkov wrote:
> On Fri, Feb 19, 2021 at 11:01:58PM +0100, Peter Zijlstra wrote:
> > We could, but it so happens Joerg is also wanting negative features.
>
> Juergen.

Argh! I should stick to jgross. Sorry.

> > So I was thikning that perhaps we can convince Boris they're not
> > really all that aweful after all :-)
>
> Well, I'm not crazy about this, TBH - I totally agree with Josh:
>
> "with objtool generating code, it's going to be a maze to figure out
> where the generated code is coming from"
>
> and without a real good reason to do this, what's the point? I know,
> because we can. :-)

Well:

- straight line execution is always better than a round-trip to
somewhere else, no matter how trivial.
- supposely EIBRS (yeah, I know, there's a paper out there) should
result in no longer using retpolines.
- I really, as in _REALLY_ don't want to do a CET enabled retpoline
- IOW, retpolines should be on their way out (knock on wood)
- doing this was fun :-)
- this stuff was mostly trivial make work stuff I could do with a head
full of snot and a headache.
- if we had negative alternatives objtool doesn't need to actually
rewrite code in this case. It could simply emit alternative entries
and call it a day.
- objtool already rewrites code
- I have more cases for objtool to rewrite code (I'll see if I can
rebase and post that this weekend -- no promises).
- also https://lkml.kernel.org/r/20200625200235.GQ4781@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx