On Sat, 2018-01-13 at 08:36 -0800, H.J. Lu wrote:
> On Sat, Jan 13, 2018 at 8:28 AM, Florian Weimer <f...@deneb.enyo.de> wrote:
> > 
> > * H. J. Lu:
> > 
> > > 
> > > On Fri, Jan 12, 2018 at 10:00 AM, Jan Hubicka <hubi...@ucw.cz> wrote:
> > > > 
> > > > > 
> > > > > Add 'V', a special modifier which prints the name of the full integer
> > > > > register without '%'.  For
> > > > > 
> > > > > extern void (*func_p) (void);
> > > > > 
> > > > > void
> > > > > foo (void)
> > > > > {
> > > > >   asm ("call __x86_indirect_thunk_%V0" : : "a" (func_p));
> > > > > }
> > > 
> > > > 
> > > > Seems reasonable. Purpose of this is to make posible to call thunks
> > > > from asm statements, right?
> > >
> > > Yes.
> >
> > Can you actually do this in practice?  What about the red zone and CFI
> > annotations?
>
> This is used by kernel, which doesn't use red-zone.  David, does it
> work for kernel?

Yes. I did start by using it everywhere, but Linus asked me to put the
thunks inline instead. Now we only have one instance of it left, in the
CALL_SPEC macro used for inline asm:
http://git.infradead.org/users/dwmw2/linux-retpoline.git/blob/76b043848fd22dbf7f8bf3a1452f8c70d557b860:/arch/x86/include/asm/nospec-branch.h#l89

It's used from places like this:
http://git.infradead.org/users/dwmw2/linux-retpoline.git/commitdiff/e70e5892b28c18f517f29ab6e83bd57705104b31
http://git.infradead.org/users/dwmw2/linux-retpoline.git/commitdiff/ea08816d5b185ab3d09e95e393f265af54560350

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to