Skip to content
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

asm: cleanups for v4 ISA #1214

Merged
merged 6 commits into from
Nov 8, 2023
Merged

asm: cleanups for v4 ISA #1214

merged 6 commits into from
Nov 8, 2023

Conversation

lmb
Copy link
Collaborator

@lmb lmb commented Nov 8, 2023

asm: rename SMov to MovSX

Signed-off-by: Lorenz Bauer <lmb@isovalent.com>

asm: return an error when extended opcodes have offset

Signed-off-by: Lorenz Bauer <lmb@isovalent.com>

asm: make extended ALUOp easier to understand

Rejig the extended ALUOp a litte to make the encoding a little bit easier to
understand. For MovSX we don't need to encode the width directly in the
extended Op, so simplify the encoding to just be consecutive numbers.

Signed-off-by: Lorenz Bauer <lmb@isovalent.com>

asm: correct jumpMask

We don't need to extend the jump opcode yet, so we shouldn't reuse aluMask.

Signed-off-by: Lorenz Bauer <lmb@isovalent.com>

asm: fix OpCode doc comment

The diagrams are aligned in a way that makes it difficult to figure out
which field a bit belongs to.

Signed-off-by: Lorenz Bauer <lmb@isovalent.com>

asm: refuse marshaling unknown extended opcodes

We currently rely on the low byte of OpCode to be a valid BPF opcode. Make
this clearer by adding a method to OpCode. This allows us to reject invalid
extended opcodes during marshaling.

Signed-off-by: Lorenz Bauer <lmb@isovalent.com>

Signed-off-by: Lorenz Bauer <lmb@isovalent.com>
Signed-off-by: Lorenz Bauer <lmb@isovalent.com>
Rejig the extended ALUOp a litte to make the encoding a little bit
easier to understand. For MovSX we don't need to encode the width
directly in the extended Op, so simplify the encoding to just be
consecutive numbers.

Signed-off-by: Lorenz Bauer <lmb@isovalent.com>
We don't need to extend the jump opcode yet, so we shouldn't reuse aluMask.

Signed-off-by: Lorenz Bauer <lmb@isovalent.com>
The diagrams are aligned in a way that makes it difficult to
figure out which field a bit belongs to.

Signed-off-by: Lorenz Bauer <lmb@isovalent.com>
We currently rely on the low byte of OpCode to be a valid BPF opcode.
Make this clearer by adding a method to OpCode. This allows us to
reject invalid extended opcodes during marshaling.

Signed-off-by: Lorenz Bauer <lmb@isovalent.com>
@lmb lmb changed the title Asm opcode cleanups asm: cleanups for v4 ISA Nov 8, 2023
@lmb lmb marked this pull request as ready for review November 8, 2023 11:14
@lmb lmb merged commit bc2ae59 into cilium:main Nov 8, 2023
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants