diff mbox series

[bpf-next,1/4] bpf: Add new macro BPF_ALU32 and BPF_JMP64

Message ID 1675254998-4951-2-git-send-email-yangtiezhu@loongson.cn (mailing list archive)
State Rejected
Delegated to: BPF
Headers show
Series bpf: Replace BPF_ALU and BPF_JMP with BPF_ALU32 and BPF_JMP64 | expand

Checks

Context Check Description
bpf/vmtest-bpf-next-VM_Test-1 success Logs for ShellCheck
bpf/vmtest-bpf-next-VM_Test-2 success Logs for build for aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-3 success Logs for build for aarch64 with llvm-17
bpf/vmtest-bpf-next-VM_Test-5 success Logs for build for x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-6 success Logs for build for x86_64 with llvm-17
bpf/vmtest-bpf-next-VM_Test-7 success Logs for llvm-toolchain
bpf/vmtest-bpf-next-VM_Test-8 success Logs for set-matrix
bpf/vmtest-bpf-next-VM_Test-4 success Logs for build for s390x with gcc
bpf/vmtest-bpf-next-VM_Test-9 success Logs for test_maps on aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-10 success Logs for test_maps on aarch64 with llvm-17
bpf/vmtest-bpf-next-VM_Test-12 success Logs for test_maps on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-13 success Logs for test_maps on x86_64 with llvm-17
bpf/vmtest-bpf-next-VM_Test-14 fail Logs for test_progs on aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-15 success Logs for test_progs on aarch64 with llvm-17
bpf/vmtest-bpf-next-VM_Test-17 success Logs for test_progs on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-18 success Logs for test_progs on x86_64 with llvm-17
bpf/vmtest-bpf-next-VM_Test-19 success Logs for test_progs_no_alu32 on aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-20 success Logs for test_progs_no_alu32 on aarch64 with llvm-17
bpf/vmtest-bpf-next-VM_Test-22 success Logs for test_progs_no_alu32 on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-23 success Logs for test_progs_no_alu32 on x86_64 with llvm-17
bpf/vmtest-bpf-next-VM_Test-24 success Logs for test_progs_no_alu32_parallel on aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-25 success Logs for test_progs_no_alu32_parallel on aarch64 with llvm-17
bpf/vmtest-bpf-next-VM_Test-27 success Logs for test_progs_no_alu32_parallel on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-28 success Logs for test_progs_no_alu32_parallel on x86_64 with llvm-17
bpf/vmtest-bpf-next-VM_Test-29 success Logs for test_progs_parallel on aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-30 success Logs for test_progs_parallel on aarch64 with llvm-17
bpf/vmtest-bpf-next-VM_Test-32 success Logs for test_progs_parallel on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-33 success Logs for test_progs_parallel on x86_64 with llvm-17
bpf/vmtest-bpf-next-VM_Test-34 success Logs for test_verifier on aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-35 success Logs for test_verifier on aarch64 with llvm-17
bpf/vmtest-bpf-next-VM_Test-36 success Logs for test_verifier on s390x with gcc
bpf/vmtest-bpf-next-VM_Test-37 success Logs for test_verifier on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-38 success Logs for test_verifier on x86_64 with llvm-17
bpf/vmtest-bpf-next-VM_Test-21 fail Logs for test_progs_no_alu32 on s390x with gcc
bpf/vmtest-bpf-next-PR fail PR summary
bpf/vmtest-bpf-next-VM_Test-11 success Logs for test_maps on s390x with gcc
bpf/vmtest-bpf-next-VM_Test-16 fail Logs for test_progs on s390x with gcc
bpf/vmtest-bpf-next-VM_Test-26 success Logs for test_progs_no_alu32_parallel on s390x with gcc
bpf/vmtest-bpf-next-VM_Test-31 success Logs for test_progs_parallel on s390x with gcc

Commit Message

Tiezhu Yang Feb. 1, 2023, 12:36 p.m. UTC
In the current code, BPF_ALU means BPF_ALU32, but BPF_JMP means BPF_JMP64,
it is a little confusing at the first glance, add new macro BPF_ALU32 and
BPF_JMP64, then we can replace the ambiguos macro BPF_ALU and BPF_JMP with
new macro BPF_ALU32 and BPF_JMP64 step by step, BPF_ALU and BPF_JMP can be
removed from the uapi header file in some day.

Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---
 include/uapi/linux/bpf.h       | 2 ++
 tools/include/uapi/linux/bpf.h | 2 ++
 2 files changed, 4 insertions(+)

Comments

Dave Thaler Feb. 1, 2023, 2:59 p.m. UTC | #1
Forwarding this to the bpf@ietf.org list for visibility, since the instruction-set.rst
change would affect the Internet Draft proposed for cross-platform standardization.

> -----Original Message-----
> From: Tiezhu Yang <yangtiezhu@loongson.cn>
> Sent: Wednesday, February 1, 2023 4:37 AM
> To: Alexei Starovoitov <ast@kernel.org>; Daniel Borkmann
> <daniel@iogearbox.net>; Andrii Nakryiko <andrii@kernel.org>
> Cc: bpf@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: [PATCH bpf-next 1/4] bpf: Add new macro BPF_ALU32 and
> BPF_JMP64
> 
> In the current code, BPF_ALU means BPF_ALU32, but BPF_JMP means
> BPF_JMP64, it is a little confusing at the first glance, add new macro
> BPF_ALU32 and BPF_JMP64, then we can replace the ambiguos macro
> BPF_ALU and BPF_JMP with new macro BPF_ALU32 and BPF_JMP64 step by
> step, BPF_ALU and BPF_JMP can be removed from the uapi header file in
> some day.
> 
> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
> ---
>  include/uapi/linux/bpf.h       | 2 ++
>  tools/include/uapi/linux/bpf.h | 2 ++
>  2 files changed, 4 insertions(+)
> 
> diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h index
> ba0f0cf..a118c43 100644
> --- a/include/uapi/linux/bpf.h
> +++ b/include/uapi/linux/bpf.h
> @@ -15,6 +15,8 @@
> 
>  /* instruction classes */
>  #define BPF_JMP32	0x06	/* jmp mode in word width */
> +#define BPF_JMP64	0x05	/* jmp mode in double word width */
> +#define BPF_ALU32	0x04	/* alu mode in word width */
>  #define BPF_ALU64	0x07	/* alu mode in double word width */
> 
>  /* ld/ldx fields */
> diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h
> index 7f024ac..014b449 100644
> --- a/tools/include/uapi/linux/bpf.h
> +++ b/tools/include/uapi/linux/bpf.h
> @@ -15,6 +15,8 @@
> 
>  /* instruction classes */
>  #define BPF_JMP32	0x06	/* jmp mode in word width */
> +#define BPF_JMP64	0x05	/* jmp mode in double word width */
> +#define BPF_ALU32	0x04	/* alu mode in word width */
>  #define BPF_ALU64	0x07	/* alu mode in double word width */
> 
>  /* ld/ldx fields */
> --
> 2.1.0
diff mbox series

Patch

diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index ba0f0cf..a118c43 100644
--- a/include/uapi/linux/bpf.h
+++ b/include/uapi/linux/bpf.h
@@ -15,6 +15,8 @@ 
 
 /* instruction classes */
 #define BPF_JMP32	0x06	/* jmp mode in word width */
+#define BPF_JMP64	0x05	/* jmp mode in double word width */
+#define BPF_ALU32	0x04	/* alu mode in word width */
 #define BPF_ALU64	0x07	/* alu mode in double word width */
 
 /* ld/ldx fields */
diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h
index 7f024ac..014b449 100644
--- a/tools/include/uapi/linux/bpf.h
+++ b/tools/include/uapi/linux/bpf.h
@@ -15,6 +15,8 @@ 
 
 /* instruction classes */
 #define BPF_JMP32	0x06	/* jmp mode in word width */
+#define BPF_JMP64	0x05	/* jmp mode in double word width */
+#define BPF_ALU32	0x04	/* alu mode in word width */
 #define BPF_ALU64	0x07	/* alu mode in double word width */
 
 /* ld/ldx fields */