feat: SIMD-0321 provide instruction-data VM address in r2#208
Open
7layermagik wants to merge 1 commit intodevfrom
Open
feat: SIMD-0321 provide instruction-data VM address in r2#2087layermagik wants to merge 1 commit intodevfrom
7layermagik wants to merge 1 commit intodevfrom
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
Implements SIMD-0321, which provides the VM address of the instruction data buffer in register
r2at program entrypoint. This allows BPF programs to locate their instruction data within the serialized input region without scanning.Changes
ProvideInstructionDataOffsetInVmR2(5xXZc66h4UdB6Yq7FzdBxBiRAFMMScMLwHxk2QZDaNZL) topkg/features/gates.goserializeParametersAlignedandserializeParametersUnalignednow return the byte offset of the instruction data within the serialized input buffer (offset past the 8-byte length prefix). Both aligned and unaligned paths compute this identically.InputDataVaddrfield toVMOptsandInterpreterstructs. When the feature is active,InputDataVaddris set toVaddrInput + instrDataOffset, giving the absolute VM address of the instruction data bytes.r2is initialized toInputDataVaddrat interpreter startup (alongside the existingr1 = VaddrInput). When the feature is inactive,r2remains 0 (no behavioral change for existing programs).Agave reference
agave/programs/bpf_loader/src/lib.rs—create_vmsetsr2frominstruction_data_offsetagave/programs/bpf_loader/src/serialization.rs—serialize_parameters_alignedreturnsinstruction_data_offsetprovide_instruction_data_offset_in_vm_r2🤖 Generated with Claude Code