diff options
author | Yonghong Song <yonghong.song@linux.dev> | 2023-07-27 18:11:56 -0700 |
---|---|---|
committer | Quentin Monnet <qmonnet+github@qoba.lt> | 2023-08-29 12:34:13 +0100 |
commit | a3e7b21f33b6456dbe21fac6aa91723205bd112e (patch) | |
tree | 215e11b2149c4b09d46085f84eaff3198f0394c0 | |
parent | 2a381f2bdbab48cfb1c880c77807871793bde18c (diff) | |
download | bpftool-a3e7b21f33b6456dbe21fac6aa91723205bd112e.tar.gz |
bpf: Support new sign-extension load insns
Add interpreter/jit support for new sign-extension load insns
which adds a new mode (BPF_MEMSX).
Also add verifier support to recognize these insns and to
do proper verification with new insns. In verifier, besides
to deduce proper bounds for the dst_reg, probed memory access
is also properly handled.
Acked-by: Eduard Zingerman <eddyz87@gmail.com>
Signed-off-by: Yonghong Song <yonghong.song@linux.dev>
Link: https://lore.kernel.org/r/20230728011156.3711870-1-yonghong.song@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
-rw-r--r-- | include/uapi/linux/bpf.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h index 7fc98f4..14fd26b 100644 --- a/include/uapi/linux/bpf.h +++ b/include/uapi/linux/bpf.h @@ -19,6 +19,7 @@ /* ld/ldx fields */ #define BPF_DW 0x18 /* double word (64-bit) */ +#define BPF_MEMSX 0x80 /* load with sign extension */ #define BPF_ATOMIC 0xc0 /* atomic memory ops - op type in immediate */ #define BPF_XADD 0xc0 /* exclusive add - legacy name */ |