On Fri, 2024-03-29 at 11:47 -0700, Andrii Nakryiko wrote: > Add two new BPF instructions for dealing with per-CPU memory. > > One, BPF_LDX | BPF_ADDR_PERCPU | BPF_DW (where BPF_ADD_PERCPU is unused > 0xe0 opcode), resolved provided per-CPU address (offset) to an absolute > address where per-CPU data resides for "this" CPU. This is the most universal, > and, strictly speaking, the only per-CPU BPF instruction necessary. > > I also added BPF_LDX | BPF_MEM_PERCPU | BPF_{B,H,W,DW} (BPF_MEM_PERCPU using > another unused 0xc0 opcode), which can be considered an optimization > instruction, which allows to *read* per-CPU data up to 8 bytes in one > instruction, without having to first resolve the address and then > dereferencing the memory. This one is used in inlining of > bpf_get_smp_processor_id(), but it would be fine to implement the latter with > BPF_ADD_PERCPU, followed by normal BPF_LDX | BPF_MEM, so I'm fine dropping > this one, if requested. Hi Andrii, I've read through the series and it looks good (modulo architecture related issues reported by CI). Thanks, Eduard