Thread (37 messages) 37 messages, 4 authors, 2021-11-23

Re: [PATCH v3 bpf-next 03/13] bpf: Prepare relo_core.c for kernel duty.

From: Alexei Starovoitov <hidden>
Date: 2021-11-20 16:24:11

On Sat, Nov 20, 2021 at 7:27 AM Matteo Croce [off-list ref] wrote:
On Sat, Nov 20, 2021 at 4:33 AM Alexei Starovoitov
[off-list ref] wrote:
quoted
From: Alexei Starovoitov <ast@kernel.org>

Make relo_core.c to be compiled for the kernel and for user space libbpf.

Note the patch is reducing BPF_CORE_SPEC_MAX_LEN from 64 to 32.
This is the maximum number of nested structs and arrays.
For example:
 struct sample {
     int a;
     struct {
         int b[10];
     };
 };

 struct sample *s = ...;
 int y = &s->b[5];
I don't understand this. Is this intentional, or it should be one of:

int y = s->b[5];
int *y = &s->b[5];
Eagle eye. I copy pasted this typo from libbpf.
Will fix in all places at once either in a respin or in a separate patch.
For the purpose of the example it could be either.
int *y = &s->b[5]; is a relocatable ADD.
int y = s->b[5]; is a relocatable LDX.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help