[llvm-dev] retpoline mitigation and 6.0

David Woodhouse via llvm-dev llvm-dev at lists.llvm.org
Wed Feb 7 12:44:32 PST 2018


On Wed, 2018-02-07 at 10:11 -0800, Guenter Roeck wrote:

> On Wed, Feb 07, 2018 at 10:49:25AM +0000, David Woodhouse wrote:
> > Hm, please could we also have the %V asm constraint modifier? That
> > allows us to emit calls to the thunks from inline asm using the
> > register that the compiler chose for us:
> > 
> >  asm volatile ("call __x86_indirect_thunk_%V[thunk_target]" : :
> > 		[thunk_target] "r" (the_function)); 
> > 
> > Other than that, I get the following errors with LLVM+Clang master, and
> > my tree at
> > http://git.infradead.org/users/dwmw2/linux-retpoline.git/shortlog/refs/heads/ibpb
> > 
> I tried ToT clang with Linux upstream as well as chromeos-4.14,
> with 'defconfig'. I don't see any errors when building x86_64.
> Lots and lots of warnings, though.

The defconfig doesn't build here either; it still includes the cpuidle
bits which don't build. I'll update LLVM/clang and try again, in case
it was fixed between your attempt and mine...


> I can disable the i915 driver, but the "invalid output size for
> constraint '=q'" happens all over the place. Ultimately this means
> that I can not really test a 32-bit build, though it would not build
> anyway because it requires the following symbols
> 
> 	U __x86_indirect_thunk_esp
> 	U __x86_indirect_thunk

The latter I can live with, as discussed, for 32-bit only. We don't
care about CET compatibility there, so I'm OK to implement the bare
ret-equivalent __x86_indirect_thunk.

The former... wtf? Can you show me the code that actually *calls* that.
I am having difficulty imagining any situation in which that's sane.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5213 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180207/9a7ad1d3/attachment.bin>


More information about the llvm-dev mailing list