-
Notifications
You must be signed in to change notification settings - Fork 136
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
Fix atomic alu with fetch #546
Fix atomic alu with fetch #546
Conversation
Additional failure:
|
Invalid instruction opcode: This translates as EBPF_ATOMIC_OP_XCHG without the fetch bit set... |
Signed-off-by: Alan Jowett <[email protected]>
Signed-off-by: Alan Jowett <[email protected]>
Signed-off-by: Alan Jowett <[email protected]>
1b6eee2
to
6668483
Compare
Signed-off-by: Alan Jowett <[email protected]>
I am sorry for the delay! I have started to review but did not get as far as I would have liked! I will (I hope) finish up tomorrow! |
On a related note, what do you think about "sprucing up" the disassembler's output with some optional debugging and warning information? Given the program in
|
Signed-off-by: Alan Jowett <[email protected]>
Signed-off-by: Alan Jowett <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This pull request introduces support for atomic operations in the disassembler and improves the handling of atomic compare-exchange instructions in the JIT compiler. The most important changes include handling atomic operations in the disassembler, saving the original value of the source register in the JIT compiler, and ensuring atomic compare-exchange instructions are correctly implemented.
Disassembler Enhancements:
disassemble_one
function inubpf/disassembler.py
. This includes handling various atomic opcodes and generating appropriate assembly instructions.JIT Compiler Improvements:
emit_atomic_fetch_alu
invm/ubpf_jit_x86_64.c
to handle cases where the source register isRAX
by saving the original value in eitherR10
orR11
. This ensures the atomic compare-exchange instruction does not overwrite the source register.emit_atomic_xor32
andemit_atomic_compare_exchange32
to remove unnecessary blank lines, improving code readability. [1] [2]translate
function by removing extra blank lines for better code clarity.