Re: [PATCH] x86/retpoline: Fill return stack buffer on vmexit

From: Peter Zijlstra
Date: Thu Jan 11 2018 - 04:32:58 EST


On Thu, Jan 11, 2018 at 09:07:09AM +0000, Woodhouse, David wrote:
> On Thu, 2018-01-11 at 09:49 +0100, Boris Petkov wrote:
> > On January 11, 2018 9:42:38 AM GMT+01:00, Peter Zijlstra wrote:
> > >Or we teach the alternative thing to patch in a jmp to end instead of
> > >NOP padding the entire thing as soon as the jmp (3 bytes) fits ?
> >
> > Or, even better: use alternative_call() to call functions instead of patching gazillion bytes.
>
> For this one I kind of wanted to keep it as a macro so we can select
> which register it uses.

can't you do lovely things like:

volatile asm ("call __fill_rsb_thunk_%1" : : "r" (dummy))

which would still let gcc select the register ?