Re: [PATCH bpf-next 02/10] libbpf: implement BPF CO-RE offset relocation algorithm

2019-07-29 Thread Song Liu
> On Jul 24, 2019, at 12:27 PM, Andrii Nakryiko wrote: > > This patch implements the core logic for BPF CO-RE offsets relocations. > All the details are described in code comments. > > Signed-off-by: Andrii Nakryiko > --- > tools/lib/bpf/libbpf.c | 866 +++

Re: [PATCH bpf-next 02/10] libbpf: implement BPF CO-RE offset relocation algorithm

2019-07-27 Thread Song Liu
> On Jul 27, 2019, at 12:09 PM, Andrii Nakryiko > wrote: > > On Sat, Jul 27, 2019 at 11:59 AM Song Liu wrote: >> >> >> >>> On Jul 26, 2019, at 11:11 PM, Andrii Nakryiko >>> wrote: >>> >>> On Thu, Jul 25, 2019 at 12:32 PM Song Liu wrote: > On Jul 24, 2019, at 12:2

Re: [PATCH bpf-next 02/10] libbpf: implement BPF CO-RE offset relocation algorithm

2019-07-27 Thread Andrii Nakryiko
On Sat, Jul 27, 2019 at 2:29 PM Yonghong Song wrote: > > > > On 7/27/19 11:24 AM, Andrii Nakryiko wrote: > > On Sat, Jul 27, 2019 at 10:00 AM Alexei Starovoitov wrote: > >> > >> On 7/26/19 11:25 PM, Andrii Nakryiko wrote: > > + } else if (class == BPF_ST && BPF_MODE(insn->code) == BPF_MEM

Re: [PATCH bpf-next 02/10] libbpf: implement BPF CO-RE offset relocation algorithm

2019-07-27 Thread Yonghong Song
On 7/27/19 11:24 AM, Andrii Nakryiko wrote: > On Sat, Jul 27, 2019 at 10:00 AM Alexei Starovoitov wrote: >> >> On 7/26/19 11:25 PM, Andrii Nakryiko wrote: > + } else if (class == BPF_ST && BPF_MODE(insn->code) == BPF_MEM) { > + if (insn->imm != orig_off) > +

Re: [PATCH bpf-next 02/10] libbpf: implement BPF CO-RE offset relocation algorithm

2019-07-27 Thread Andrii Nakryiko
On Sat, Jul 27, 2019 at 11:59 AM Song Liu wrote: > > > > > On Jul 26, 2019, at 11:11 PM, Andrii Nakryiko > > wrote: > > > > On Thu, Jul 25, 2019 at 12:32 PM Song Liu wrote: > >> > >> > >> > >>> On Jul 24, 2019, at 12:27 PM, Andrii Nakryiko wrote: > >>> > >>> This patch implements the core logi

Re: [PATCH bpf-next 02/10] libbpf: implement BPF CO-RE offset relocation algorithm

2019-07-27 Thread Song Liu
> On Jul 26, 2019, at 11:11 PM, Andrii Nakryiko > wrote: > > On Thu, Jul 25, 2019 at 12:32 PM Song Liu wrote: >> >> >> >>> On Jul 24, 2019, at 12:27 PM, Andrii Nakryiko wrote: >>> >>> This patch implements the core logic for BPF CO-RE offsets relocations. >>> All the details are describ

Re: [PATCH bpf-next 02/10] libbpf: implement BPF CO-RE offset relocation algorithm

2019-07-27 Thread Andrii Nakryiko
On Sat, Jul 27, 2019 at 10:00 AM Alexei Starovoitov wrote: > > On 7/26/19 11:25 PM, Andrii Nakryiko wrote: > >>> + } else if (class == BPF_ST && BPF_MODE(insn->code) == BPF_MEM) { > >>> + if (insn->imm != orig_off) > >>> + return -EINVAL; > >>> + ins

Re: [PATCH bpf-next 02/10] libbpf: implement BPF CO-RE offset relocation algorithm

2019-07-27 Thread Alexei Starovoitov
On 7/26/19 11:25 PM, Andrii Nakryiko wrote: >>> + } else if (class == BPF_ST && BPF_MODE(insn->code) == BPF_MEM) { >>> + if (insn->imm != orig_off) >>> + return -EINVAL; >>> + insn->imm = new_off; >>> + pr_debug("prog '%s': patched insn #%

Re: [PATCH bpf-next 02/10] libbpf: implement BPF CO-RE offset relocation algorithm

2019-07-26 Thread Andrii Nakryiko
On Thu, Jul 25, 2019 at 4:18 PM Alexei Starovoitov wrote: > > On Wed, Jul 24, 2019 at 12:27:34PM -0700, Andrii Nakryiko wrote: > > This patch implements the core logic for BPF CO-RE offsets relocations. > > All the details are described in code comments. > > > > Signed-off-by: Andrii Nakryiko > >

Re: [PATCH bpf-next 02/10] libbpf: implement BPF CO-RE offset relocation algorithm

2019-07-26 Thread Andrii Nakryiko
On Thu, Jul 25, 2019 at 12:32 PM Song Liu wrote: > > > > > On Jul 24, 2019, at 12:27 PM, Andrii Nakryiko wrote: > > > > This patch implements the core logic for BPF CO-RE offsets relocations. > > All the details are described in code comments. > > Some description in the change log is still usefu

Re: [PATCH bpf-next 02/10] libbpf: implement BPF CO-RE offset relocation algorithm

2019-07-25 Thread Alexei Starovoitov
On Wed, Jul 24, 2019 at 12:27:34PM -0700, Andrii Nakryiko wrote: > This patch implements the core logic for BPF CO-RE offsets relocations. > All the details are described in code comments. > > Signed-off-by: Andrii Nakryiko > --- > tools/lib/bpf/libbpf.c | 866 +++

Re: [PATCH bpf-next 02/10] libbpf: implement BPF CO-RE offset relocation algorithm

2019-07-25 Thread Song Liu
> On Jul 24, 2019, at 12:27 PM, Andrii Nakryiko wrote: > > This patch implements the core logic for BPF CO-RE offsets relocations. > All the details are described in code comments. Some description in the change log is still useful. Please at least copy-paste key comments here. And, this i

[PATCH bpf-next 02/10] libbpf: implement BPF CO-RE offset relocation algorithm

2019-07-24 Thread Andrii Nakryiko
This patch implements the core logic for BPF CO-RE offsets relocations. All the details are described in code comments. Signed-off-by: Andrii Nakryiko --- tools/lib/bpf/libbpf.c | 866 - tools/lib/bpf/libbpf.h | 1 + 2 files changed, 861 insertions(+), 6