[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180222045906.62xfc7aqc5hbe4o4@ast-mbp>
Date: Wed, 21 Feb 2018 20:59:08 -0800
From: Alexei Starovoitov <alexei.starovoitov@...il.com>
To: Eric Dumazet <eric.dumazet@...il.com>
Cc: Daniel Borkmann <daniel@...earbox.net>, ast@...nel.org,
torvalds@...ux-foundation.org, netdev@...r.kernel.org
Subject: Re: [PATCH bpf] bpf, x64: implement retpoline for tail call
On Wed, Feb 21, 2018 at 07:53:22PM -0800, Eric Dumazet wrote:
> > So what kinda comment there would make sense?
>
> I was thinking of something very explicit :
>
> /* byte sequence for following assembly code used by eBPF
> call ...
> ...
> retq
> */
> #define RETPOLINE_RAX_DIRECT_FOR_EBPF \
> EMIT1_off32(0xE8, 7); /* callq <set_up_target> */ \
> /* capture_spec: */ \
> EMIT2(0xF3, 0x90); /* pause */ \
> EMIT3(0x0F, 0xAE, 0xE8); /* lfence */ \
> EMIT2(0xEB, 0xF9); /* jmp <capture_spec> */ \
> /* set_up_target: */ \
> EMIT4(0x48, 0x89, 0x04, 0x24); /* mov %rax,(%rsp) */ \
> EMIT1(0xC3); /* retq */ \
got it. yeah. makes sense to me.
Powered by blists - more mailing lists