Re: [RFC][PATCH 3/3] x86/entry, ORC: Teach objtool/unwind_orc about stack irq swizzles
From: Thomas Gleixner
Date: Thu May 07 2020 - 17:25:00 EST
Josh Poimboeuf <jpoimboe@xxxxxxxxxx> writes:
> On Thu, May 07, 2020 at 07:38:09PM +0200, Peter Zijlstra wrote:
>> On Thu, May 07, 2020 at 06:10:23PM +0200, Peter Zijlstra wrote:
>> Much simpler, also works.
>
> Doing the stack switch in inline asm is just nasty.
Matter of personal preference :)
> Also, a frame pointer makes this SO much easier for ORC/objtool, no
> funky hints needed. In fact maybe we can get rid of the indirect hint
> things altogether, which means even more deleted code.
>
> This is much cleaner, and it boots:
Well, yes. I thought about that and it clearly works fine. There is a
downside because it adds the indirect call to all system vectors.
The device interrupt part is fine, it has an indirect call already, but
for system vectors and in particular the rescheduling IPI its bad. Not
bad because of the indirect call per se, but bad because of the
ratpoutine mitigation mess.
My other alternative was to emit switcheroo into ASM for each system
vector. Not pretty either
But over our IRC conversation I came up with a 3rd variant:
For most of the vectors the indirect call overhead is just noise, so
we can run them through the ASM switcher, but for the resched IPI
we can just use a separate direct call stub in ASM.
I can live with that. I might have to pay up for Peter's headaches to
teach objtool, but that's a different story. Let me check how many beers
he owes me first ...
Thanks,
tglx