feat: legacy XADD and correct JIT code buffer sizing#145
Merged
Conversation
Contributor
Author
|
Hi, @qmonnet! Could you please take a look at this PR when you have a moment? Thanks! |
Owner
|
Yep sorry, it's been a busy few weeks, but this is still on my list. I'll try to take a deeper look at it soon. |
qmonnet
requested changes
May 29, 2026
Owner
There was a problem hiding this comment.
Thanks, and apologies again for the delay.
It looks good overall, but I've got two comments:
- Can you please adjust the verifier check to keep rejecting newer atomic operations (see comment below)?
- Could you please make the JIT allocation fix a separate commit? It would make it easier to look at it again in the future, if necessary.
There's also test_jit_xadd_w_dw() which currently doesn't pass with --no-default-features ("Error: No custom executable memory set, call set_jit_exec_memory() to set one").
Add non-fetch ST_W_XADD/ST_DW_XADD so eBPF programs that use atomic add-to-memory can run in the interpreter, x86_64 JIT, and Cranelift; extend the verifier and tests accordingly. Signed-off-by: Sergey Kacheev <s.kacheev@gmail.com>
Fix JIT allocation by sizing the executable buffer with a dry run before emitting code, instead of assuming a single fixed page. Signed-off-by: Sergey Kacheev <s.kacheev@gmail.com>
Contributor
Author
|
Thanks for the hints and explanations! |
qmonnet
approved these changes
Jun 3, 2026
qmonnet
left a comment
Owner
There was a problem hiding this comment.
Looks good now, much better with two commits. Thank you!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi, and thanks for a great project.
I hit a wall: my program uses atomic operations and wouldn’t run- it was hitting unimplemented. After digging through the code, adding support for the legacy XADD instructions looked straightforward, so I went ahead and implemented it.
I might come back later with full atomic support, but for now I’d like to get this merged.
Thanks!