Re: [PATCH] bpf: Tweak BPF jump table optimizations for objtool compatibility

From: Josh Poimboeuf
Date: Tue May 05 2020 - 15:32:02 EST


On Tue, May 05, 2020 at 12:14:05PM -0700, Alexei Starovoitov wrote:
> >
> > Hi,
> >
> > I see the objtool warning:
> > kernel/bpf/core.o: warning: objtool: ___bpf_prog_run()+0x33: call without frame pointer save/setup
> >
> > when using:
> > gcc (SUSE Linux) 9.3.1 20200406 [revision 6db837a5288ee3ca5ec504fbd5a765817e556ac2]
> >
> > with the attached config file.
>
> Thanks Randy. I reproduced it.

This problem isn't a mystery, it's caused by __attribute__((optimize)).

The only real solution is to revert

3193c0836f20 ("bpf: Disable GCC -fgcse optimization for ___bpf_prog_run()")

Once you do that (and disable retpolines) then you should see the
problem described in my other email.

--
Josh