Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpftool: Probe for ISA v4 instruction set extension #4761

Open
wants to merge 1 commit into
base: bpf-next_base
Choose a base branch
from

Conversation

kernel-patches-daemon-bpf-rc[bot]
Copy link

Pull request for series with
subject: bpftool: Probe for ISA v4 instruction set extension
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=915866

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 442bc81
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=915866
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 442bc81
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=916007
version: 2

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 442bc81
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=916007
version: 2

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 82c1f13
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=916007
version: 2

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 4d33dc1
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=916007
version: 2

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 6e8ba49
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=916007
version: 2

This patch introduces a new probe to check whether the kernel supports
instruction set extensions v4. The v4 extension comprises several new
instructions: BPF_{SDIV,SMOD} (signed div and mod), BPF_{LD,LDX,ST,STX,MOV}
(sign-extended load/store/move), 32-bit BPF_JA (unconditional jump),
target-independent BPF_ALU64 BSWAP (byte-swapping 16/32/64). These have
been introduced in the following commits respectively:

* ec0e2da ("bpf: Support new signed div/mod instructions.")
* 1f9a1ea ("bpf: Support new sign-extension load insns")
* 8100928 ("bpf: Support new sign-extension mov insns")
* 4cd58e9 ("bpf: Support new 32bit offset jmp instruction")
* 0845c3d ("bpf: Support new unconditional bswap instruction")

Support in bpftool for previous ISA extensions were added in commit
0fd800b ("bpftool: Probe for instruction set extensions"). These probes
are useful for userspace BPF projects that want to use newer
instruction set extensions on newer kernels, to reduce the programs'
sizes or their complexity. LLVM provides the mcpu=v4 option since commit
"[BPF] support for BPF_ST instruction in codegen"
(llvm/llvm-project@8f28e80).

Changelog:

- v2:
  - moved BPF_JMP32_A macro after BPF_JMP_A in filter.h for consistency
    with include/linux/filter.h, noted by Quentin Monnet <[email protected]>

Signed-off-by: Simone Magnani <[email protected]>
Reviewed-by: Quentin Monnet <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant