lkml.org 
[lkml]   [2021]   [Oct]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 9/9] bpf,x86: Respect X86_FEATURE_RETPOLINE*
On Thu, Oct 14, 2021 at 11:46:11AM +0200, Peter Zijlstra wrote:
> On Wed, Oct 13, 2021 at 11:54:51PM +0200, Peter Zijlstra wrote:
>
> > > But the rest of eBPF JIT just emits retpolines unconditionally
> > > regardless of feature, for example see RETPOLINE_RCX_BPF_JIT(). So I'm
> > > thinking this should probably be consistent with that (or that with
> > > this).
> >
> > Argh, I grepped for __x86_indirect_thunk, and missed they're writing
> > retpolines themselves. Bah.
> >
> > Yes, that needs cleaning up. I'll go prod at that tomorrow.
>
> Bah, i've too much of a head-ache to make sense of that bpf jit code :-(
>
> Alexei, emit_fallback_jump() uses emit_jump() and provides @prog as .ip
> argument, but other sites do weird things like 'image + addrs[i]',
> presumable because @prog points to an on-stack array instead of to the
> actual text location.
>
> Also @prog is confusingly sometimes a struct bpf_prog* and sometimes a
> u8* which makes grepping really confusing.
>
> I've ended up with the below.. which is known broken-crap for 32, but is
> likely simlar for 64bit as well :-( Can you please have a look?

OK, I've got a working version (thanks to Josh for finding my
brain-fart)! I'll go repost the series soon.

\
 
 \ /
  Last update: 2021-10-20 09:35    [W:0.060 / U:0.704 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site