On Tue, 14 May 2024 at 20:32, Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote: > > Why does it do that disgusting > > struct bpf_array *array = container_of(map, struct bpf_array, map); > ... > *insn++ = BPF_ALU32_IMM(BPF_AND, BPF_REG_0, array->index_mask); > > thing? As far as I can tell, a bpf map can be embedded in many > different structures, not just that 'bpf_array' thing. Bah. It still needs to do that array->elem_size, so it's not just the spectre-v1 code that needs that 'bpf_array' thing. And the non-percpu case seems to do all the same contortions, so I don't know why the new percpu array would show issues. Oh well. I guess the bpf people will figure it out once they come back from "partying at LSFMM" as you put it. Linus