Messages in this thread | | | Subject | Re: [PATCH] x86/retpoline: Fill return stack buffer on vmexit | Date | Thu, 11 Jan 2018 09:58:41 +0000 | From | "Woodhouse, David" <> |
| |
On Thu, 2018-01-11 at 10:47 +0100, Borislav Petkov wrote: > On Thu, Jan 11, 2018 at 10:32:31AM +0100, Peter Zijlstra wrote: > > > > can't you do lovely things like: > > > > volatile asm ("call __fill_rsb_thunk_%1" : : "r" (dummy)) > > > > which would still let gcc select the register ?
I've had to do that for the __x86_indirect_thunk_\reg thunks and provide all variants thereof, and export them to modules.
I'd much rather have this one inline. If I couldn't do that (which I can, and have), then my next choice would probably have been to just hard-code it to use %eax/%r12 and emit a simple call to that from the call sites.
> Calling a function from asm is nasty because you need to pay attention > to clobbered registers as gcc doesn't see the function. > > What one can do, I *think*, is do a non-inlined wrapping function and do > all the alternative_call() fun inside. There you can do all the fun and > have callee-clobbered regs which you can use.
That's OK; it's not really a C function and it only clobbers the *one* register which is easy enough to tell __asm__() about.[unhandled content-type:application/x-pkcs7-signature] | |