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
x/net/bpf: support jump conditions on x
#27814
Comments
Add JumpIfX instructions, which implements conditional jumps based on RegA and RegX. This is in addition to the pre-existing JumpIf instruction with uses RegA and K. Simplify some of the parsing logic, and add a seperate helper for checking for "fake" JumpIfs. Add JumpIfX support to the BPF vm. Fixes golang/go#27814
Add JumpIfX instructions, which implements conditional jumps based on RegA and RegX. This is in addition to the pre-existing JumpIf instruction with uses RegA and K. These instructions are not mentionned in either the kernel's 'filter.txt' or the original BPF paper, but are supported but tools like 'bpf_asm'. Simplify some of the parsing logic, and add a seperate helper for checking for "fake" JumpIfs. Add JumpIfX support to the BPF vm. Update testdata with JumpIfX instructions. Fixes golang/go#27814
Add JumpIfX instructions, which implements conditional jumps based on RegA and RegX. This is in addition to the pre-existing JumpIf instruction with uses RegA and K. These instructions are not mentioned in either the kernel's 'filter.txt' or the original BPF paper, but are supported but tools like 'bpf_asm'. Simplify some of the parsing logic, and add a separate helper for checking for "fake" JumpIfs. Add JumpIfX support to the BPF vm. Update testdata with JumpIfX instructions, and add tests for both the assembler/disassembler and vm. Fixes golang/go#27814
Add JumpIfX instructions, which implements conditional jumps based on RegA and RegX. This is in addition to the pre-existing JumpIf instruction with uses RegA and K. These instructions are not mentioned in either the kernel's 'filter.txt' or the original BPF paper, but are supported by tools like 'bpf_asm'. Simplify some of the parsing logic, and add a separate helper for checking for "fake" JumpIfs. Add JumpIfX support to the BPF vm. Update testdata with JumpIfX instructions, and add tests for both the assembler/disassembler and vm. Fixes golang/go#27814
Add JumpIfX instructions, which implements conditional jumps using RegA and RegX. This is in addition to the pre-existing JumpIf instruction which use RegA and K. These instructions are not mentioned in either the kernel's 'filter.txt' or the original BPF paper, but are supported by tools like 'bpf_asm'. Simplify some of the parsing logic, and add a separate helper for checking for "fake" JumpIfs. Add JumpIfX support to the BPF vm. Update testdata with JumpIfX instructions, and add tests for both the assembler/disassembler and vm. Fixes golang/go#27814
Add a JumpIfX instruction which implements conditional jumps using RegA and RegX. This is in addition to the pre-existing JumpIf instruction which uses RegA and K. This instruction / addressing mode is not mentioned in either the kernel's 'filter.txt' or the original BPF paper, but are supported by tools like 'bpf_asm'. Simplify some of the parsing logic, and add a separate helper for checking for "fake" JumpIfs. Add JumpIfX support to the BPF vm. Update testdata with JumpIfX instructions, and add tests for both the assembler/disassembler and vm. Fixes golang/go#27814
Add a JumpIfX instruction which implements conditional jumps using RegA and RegX. This is in addition to the pre-existing JumpIf instruction which uses RegA and K. This instruction / addressing mode is not mentioned in either the kernel's 'filter.txt' or the original BPF paper, but are supported by tools like 'bpf_asm'. Simplify some of the parsing logic, and add a separate helper for checking for "fake" JumpIfs. Add JumpIfX support to the BPF vm. Update testdata with JumpIfX instructions, and add tests for both the assembler/disassembler and vm. Fixes golang/go#27814
Change https://golang.org/cl/136895 mentions this issue: |
Already reviewed your CL, but for reference... I would prefer to not rename JumpIf, at least not until Go has generally available modules with good versioning. I don't want to break the API of every user of this package just for a little bit of consistency. Once Go modules are out of experimental state, we can look at maybe releasing a 2.0.0 of the module. We want the VM to be able to execute any code that the asm/disasm knows how to handle. Your PR does include both, so that's a moot point now :). Thank you for contributing the extra instruction! Mildly annoying that it's not documented (or did I just completely miss it out when I implemented the package originally??) |
Add a JumpIfX instruction which implements conditional jumps using RegA and RegX. This is in addition to the pre-existing JumpIf instruction which uses RegA and K. This instruction / addressing mode is not mentioned in either the kernel's 'filter.txt' or the original BPF paper, but are supported by tools like 'bpf_asm'. Simplify some of the parsing logic, and add a separate helper for checking for "fake" JumpIfs. Add JumpIfX support to the BPF vm. Update testdata with JumpIfX instructions, and add tests for both the assembler/disassembler and vm. Fixes golang/go#27814
Add a JumpIfX instruction which implements conditional jumps using RegA and RegX. This is in addition to the pre-existing JumpIf instruction which uses RegA and K. This instruction / addressing mode is not mentioned in either the kernel's 'filter.txt' or the original BPF paper, but are supported by tools like 'bpf_asm'. Simplify some of the parsing logic, and add a separate helper for checking for "fake" JumpIfs. Add JumpIfX support to the BPF vm. Update testdata with JumpIfX instructions, and add tests for both the assembler/disassembler and vm. Fixes golang/go#27814
Add a JumpIfX instruction which implements conditional jumps using RegA and RegX. This is in addition to the pre-existing JumpIf instruction which uses RegA and K. This instruction / addressing mode is not mentioned in either the kernel's 'filter.txt' or the original BPF paper, but are supported by tools like 'bpf_asm'. Simplify some of the parsing logic, and add a separate helper for checking for "fake" JumpIfs. Add JumpIfX support to the BPF vm. Update testdata with JumpIfX instructions, and add tests for both the assembler/disassembler and vm. Fixes golang/go#27814
Add a JumpIfX instruction which implements conditional jumps using RegA and RegX. This is in addition to the pre-existing JumpIf instruction which uses RegA and K. This instruction / addressing mode is not mentioned in either the kernel's 'filter.txt' or the original BPF paper, but are supported by tools like 'bpf_asm'. Simplify some of the parsing logic, and add a separate helper for checking for "fake" JumpIfs. Add JumpIfX support to the BPF vm. Update testdata with JumpIfX instructions, and add tests for both the assembler/disassembler and vm. Fixes golang/go#27814
x
x
Add a JumpIfX instruction which implements conditional jumps using RegA and RegX. This is in addition to the pre-existing JumpIf instruction which uses RegA and K. This instruction / addressing mode is not mentionned in the original BPF paper, but is supported by tools like bpf_asm, and has recently been added to the kernel's filter.txt. Simplify some of the parsing logic, and add a separate helper for checking for "fake" JumpIfs. Add JumpIfX support to the BPF vm. Update testdata with JumpIfX instructions, and add tests for both the assembler/disassembler and vm. Fixes golang/go#27814
Currently conditionals / jumps are represented by
JumpIf
. This doesn't support conditionals / jumps that use registerx
instead of the constantk
encoded in the instruction.I have added preliminary support for this in the form of a new
JumpIfX
instruction.Questions:
JumpIf
be renamedJumpIfConstant
for consistency withALUOpConstant
&ALUOpX
?cc @danderson & @mdlayher as you seem to be the maintainers
The text was updated successfully, but these errors were encountered: