Add -mcallx option for BPF, enabled by default for v1+
BPF now supports a new -mcallx flag for indirect calls, enabled by default for modern hardware.
This commit introduces the -mcallx option for the BPF backend, which enables the use of the callx instruction for indirect calls. This instruction is part of the BPF CPU v1 ISA and is now enabled by default for v1 and above. The -mno-callx option reverts to the previous behavior of diagnosing indirect calls as errors. This change also removes the TARGET_XBPF specific handling, as -mxbpf is now solely for the assembler.
In Details
The callx instruction, part of the BPF CPU v1 ISA, was previously only enabled via -mxbpf. This commit introduces the standard -mcallx flag, which is enabled by default for CPU v1 and above, aligning with LLVM's behavior. -mno-callx restores the old diagnostic behavior for indirect calls. The -mxbpf flag's functionality has been reduced to solely passing information to the assembler, as its compiler-level effects (register saving) were removed previously.
- BPF
- Berkeley Packet Filter, a technology that allows sandboxed programs to execute in the Linux kernel without changing kernel source code.
- callx
- An instruction in some extended BPF (eBPF) versions that performs an indirect call.
- ISA
- Instruction Set Architecture. The set of commands a processor can execute.
- -mxbpf
- A GCC flag for the BPF backend that previously enabled extended features, now primarily used to pass information to the assembler.