Skip to content

Commit

Permalink
bpf: Disasm support for addr_space_cast instruction.
Browse files Browse the repository at this point in the history
LLVM generates rX = addr_space_cast(rY, dst_addr_space, src_addr_space)
instruction when pointers in non-zero address space are used by the bpf
program. Recognize this insn in uapi and in bpf disassembler.

Signed-off-by: Alexei Starovoitov <[email protected]>
Signed-off-by: Andrii Nakryiko <[email protected]>
Acked-by: Kumar Kartikeya Dwivedi <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
  • Loading branch information
Alexei Starovoitov authored and anakryiko committed Mar 26, 2024
1 parent 1675c13 commit 6de941b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/uapi/linux/bpf.h
Original file line number Diff line number Diff line change
Expand Up @@ -1339,6 +1339,10 @@ enum {
*/
#define BPF_PSEUDO_KFUNC_CALL 2

enum bpf_addr_space_cast {
BPF_ADDR_SPACE_CAST = 1,
};

/* flags for BPF_MAP_UPDATE_ELEM command */
enum {
BPF_ANY = 0, /* create new element or update existing */
Expand Down

0 comments on commit 6de941b

Please sign in to comment.