Closed Lincyaw closed 5 months ago
https://docs.kernel.org/bpf/standardization/instruction-set.html#bit-immediate-instructions
According to the documentation, MovRegImm64 is a part of 64 bit operation, the operation code should be 0x18. However, it seems that there is no support for 64-bit immediate instructions¶.
Thanks!
That is a very nice catch. I will try to add support for this as soon as possible.
It seems that for immediate 64 bit values a wide instruction encoding is used https://docs.kernel.org/bpf/standardization/instruction-set.html#instruction-encoding:~:text=Thus%20the%2064,next_imm%20%3C%3C%2032)%20%7C%20imm
The current implementation cannot support the MovReg64 well.
In
pkg/ebpf/alu_instructions.go
, although there is a function calledMovRegImm64
, however, the arguments only supports the imm32.Example
For the following simple ebpf program
The disassembled result is:
There are instructions that load imm64 to the register, however in the code, it only supports imm64.