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

2020-05-08 Thread Alexei Starovoitov
On Thu, May 07, 2020 at 09:07:33AM -0500, Josh Poimboeuf wrote: > On Wed, May 06, 2020 at 05:03:57PM -0700, Alexei Starovoitov wrote: > > > > > > diff --git a/include/linux/compiler-gcc.h > > > > > > b/include/linux/compiler-gcc.h > > > > > > index d7ee4c6bad48..05104c3cc033 100644 > > > > > >

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

2020-05-07 Thread Josh Poimboeuf
On Wed, May 06, 2020 at 05:03:57PM -0700, Alexei Starovoitov wrote: > > > > > diff --git a/include/linux/compiler-gcc.h > > > > > b/include/linux/compiler-gcc.h > > > > > index d7ee4c6bad48..05104c3cc033 100644 > > > > > --- a/include/linux/compiler-gcc.h > > > > > +++

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

2020-05-06 Thread Alexei Starovoitov
On Wed, May 06, 2020 at 04:19:45PM -0500, Josh Poimboeuf wrote: > On Wed, May 06, 2020 at 09:45:01AM -0700, Alexei Starovoitov wrote: > > On Wed, May 6, 2020 at 8:53 AM Josh Poimboeuf wrote: > > > > > > On Tue, May 05, 2020 at 04:59:39PM -0700, Alexei Starovoitov wrote: > > > > As far as

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

2020-05-06 Thread Josh Poimboeuf
On Wed, May 06, 2020 at 09:45:01AM -0700, Alexei Starovoitov wrote: > On Wed, May 6, 2020 at 8:53 AM Josh Poimboeuf wrote: > > > > On Tue, May 05, 2020 at 04:59:39PM -0700, Alexei Starovoitov wrote: > > > As far as workaround I prefer the following: > > > From

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

2020-05-06 Thread Alexei Starovoitov
On Wed, May 6, 2020 at 8:53 AM Josh Poimboeuf wrote: > > On Tue, May 05, 2020 at 04:59:39PM -0700, Alexei Starovoitov wrote: > > As far as workaround I prefer the following: > > From 94bbc27c5a70d78846a5cb675df4cf8732883564 Mon Sep 17 00:00:00 2001 > > From: Alexei Starovoitov > > Date: Tue, 5

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

2020-05-06 Thread Josh Poimboeuf
On Tue, May 05, 2020 at 04:59:39PM -0700, Alexei Starovoitov wrote: > As far as workaround I prefer the following: > From 94bbc27c5a70d78846a5cb675df4cf8732883564 Mon Sep 17 00:00:00 2001 > From: Alexei Starovoitov > Date: Tue, 5 May 2020 16:52:41 -0700 > Subject: [PATCH] bpf,objtool: tweak

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

2020-05-05 Thread Alexei Starovoitov
On Tue, May 05, 2020 at 03:28:23PM -0500, Josh Poimboeuf wrote: > On Tue, May 05, 2020 at 12:53:20PM -0700, Alexei Starovoitov wrote: > > On Tue, May 05, 2020 at 01:11:08PM -0500, Josh Poimboeuf wrote: > > > On Tue, May 05, 2020 at 10:43:00AM -0700, Alexei Starovoitov wrote: > > > > > Or, if you

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

2020-05-05 Thread Josh Poimboeuf
On Tue, May 05, 2020 at 12:53:20PM -0700, Alexei Starovoitov wrote: > On Tue, May 05, 2020 at 01:11:08PM -0500, Josh Poimboeuf wrote: > > On Tue, May 05, 2020 at 10:43:00AM -0700, Alexei Starovoitov wrote: > > > > Or, if you want to minimize the patch's impact on other arches, and keep > > > > the

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

2020-05-05 Thread Alexei Starovoitov
On Tue, May 05, 2020 at 01:11:08PM -0500, Josh Poimboeuf wrote: > On Tue, May 05, 2020 at 10:43:00AM -0700, Alexei Starovoitov wrote: > > > Or, if you want to minimize the patch's impact on other arches, and keep > > > the current patch the way it is (with bug fixed and changed patch > > >

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

2020-05-05 Thread Josh Poimboeuf
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 > >

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

2020-05-05 Thread Alexei Starovoitov
> > 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

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

2020-05-05 Thread Josh Poimboeuf
On Tue, May 05, 2020 at 10:43:00AM -0700, Alexei Starovoitov wrote: > > Or, if you want to minimize the patch's impact on other arches, and keep > > the current patch the way it is (with bug fixed and changed patch > > description), that's fine too. I can change the patch description > >

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

2020-05-05 Thread Alexei Starovoitov
On Sat, May 02, 2020 at 02:21:05PM -0500, Josh Poimboeuf wrote: > > Ideally we would get rid of that label and just change all the 'goto > select_insn' to 'goto *jumptable[insn->code]'. That allows objtool to > follow the code in both retpoline and non-retpoline cases. It also > simplifies the

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

2020-05-02 Thread Josh Poimboeuf
On Fri, May 01, 2020 at 08:06:22PM -0700, Alexei Starovoitov wrote: > On Fri, May 01, 2020 at 02:56:17PM -0500, Josh Poimboeuf wrote: > > On Fri, May 01, 2020 at 12:40:53PM -0700, Alexei Starovoitov wrote: > > > On Fri, May 01, 2020 at 02:22:04PM -0500, Josh Poimboeuf wrote: > > > > On Fri, May

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

2020-05-01 Thread Alexei Starovoitov
On Fri, May 01, 2020 at 02:56:17PM -0500, Josh Poimboeuf wrote: > On Fri, May 01, 2020 at 12:40:53PM -0700, Alexei Starovoitov wrote: > > On Fri, May 01, 2020 at 02:22:04PM -0500, Josh Poimboeuf wrote: > > > On Fri, May 01, 2020 at 12:09:30PM -0700, Alexei Starovoitov wrote: > > > > On Thu, Apr

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

2020-05-01 Thread Josh Poimboeuf
On Fri, May 01, 2020 at 12:40:53PM -0700, Alexei Starovoitov wrote: > On Fri, May 01, 2020 at 02:22:04PM -0500, Josh Poimboeuf wrote: > > On Fri, May 01, 2020 at 12:09:30PM -0700, Alexei Starovoitov wrote: > > > On Thu, Apr 30, 2020 at 02:07:43PM -0500, Josh Poimboeuf wrote: > > > > Objtool

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

2020-05-01 Thread Alexei Starovoitov
On Fri, May 01, 2020 at 02:22:04PM -0500, Josh Poimboeuf wrote: > On Fri, May 01, 2020 at 12:09:30PM -0700, Alexei Starovoitov wrote: > > On Thu, Apr 30, 2020 at 02:07:43PM -0500, Josh Poimboeuf wrote: > > > Objtool decodes instructions and follows all potential code branches > > > within a

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

2020-05-01 Thread Josh Poimboeuf
On Fri, May 01, 2020 at 12:09:30PM -0700, Alexei Starovoitov wrote: > On Thu, Apr 30, 2020 at 02:07:43PM -0500, Josh Poimboeuf wrote: > > Objtool decodes instructions and follows all potential code branches > > within a function. But it's not an emulator, so it doesn't track > > register values.

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

2020-05-01 Thread Alexei Starovoitov
On Thu, Apr 30, 2020 at 02:07:43PM -0500, Josh Poimboeuf wrote: > Objtool decodes instructions and follows all potential code branches > within a function. But it's not an emulator, so it doesn't track > register values. For that reason, it usually can't follow > intra-function indirect

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

2020-04-30 Thread Josh Poimboeuf
Objtool decodes instructions and follows all potential code branches within a function. But it's not an emulator, so it doesn't track register values. For that reason, it usually can't follow intra-function indirect branches, unless they're using a jump table which follows a certain format