Skip to content

Commit

Permalink
eBPF.md: add Jump-32bit class instructions
Browse files Browse the repository at this point in the history
Reflecting the recent addition of 32-bit jump instruction class support
to the Linux kernel [0], add the related instructions to the unofficial
spec to keep it up-to-date.

[0] merge commit ae575c8a9868 ("Merge branch 'jmp32-insns'")
  • Loading branch information
qmonnet committed Jan 28, 2019
1 parent b5ac15b commit d90c7bc
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions eBPF.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ Opcode | Mnemonic | Pseudocode

## Branch Instructions

### 64-bit

Opcode | Mnemonic | Pseudocode
-------|---------------------|------------------------
0x05 | ja +off | PC += off
Expand Down Expand Up @@ -185,3 +187,33 @@ Opcode | Mnemonic | Pseudocode
0xdd | jsle dst, src, +off | PC += off if dst <= src (signed)
0x85 | call imm | Function call
0x95 | exit | return r0

### 32-bit

These instructions use only the lower 32 bits of their operands and zero the
upper 32 bits of the destination register.

Opcode | Mnemonic | Pseudocode
-------|---------------------|------------------------
0x16 | jeq dst, imm, +off | PC += off if dst == imm
0x1e | jeq dst, src, +off | PC += off if dst == src
0x26 | jgt dst, imm, +off | PC += off if dst > imm
0x2e | jgt dst, src, +off | PC += off if dst > src
0x36 | jge dst, imm, +off | PC += off if dst >= imm
0x3e | jge dst, src, +off | PC += off if dst >= src
0xa6 | jlt dst, imm, +off | PC += off if dst < imm
0xae | jlt dst, src, +off | PC += off if dst < src
0xb6 | jle dst, imm, +off | PC += off if dst <= imm
0xbe | jle dst, src, +off | PC += off if dst <= src
0x46 | jset dst, imm, +off | PC += off if dst & imm
0x4e | jset dst, src, +off | PC += off if dst & src
0x56 | jne dst, imm, +off | PC += off if dst != imm
0x5e | jne dst, src, +off | PC += off if dst != src
0x66 | jsgt dst, imm, +off | PC += off if dst > imm (signed)
0x6e | jsgt dst, src, +off | PC += off if dst > src (signed)
0x76 | jsge dst, imm, +off | PC += off if dst >= imm (signed)
0x7e | jsge dst, src, +off | PC += off if dst >= src (signed)
0xc6 | jslt dst, imm, +off | PC += off if dst < imm (signed)
0xce | jslt dst, src, +off | PC += off if dst < src (signed)
0xd6 | jsle dst, imm, +off | PC += off if dst <= imm (signed)
0xde | jsle dst, src, +off | PC += off if dst <= src (signed)

0 comments on commit d90c7bc

Please sign in to comment.