From d90c7bc3bfc11875e3323ba4f269de72a87e647d Mon Sep 17 00:00:00 2001 From: Quentin Monnet Date: Mon, 28 Jan 2019 14:59:56 +0000 Subject: [PATCH] eBPF.md: add Jump-32bit class instructions 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'") --- eBPF.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/eBPF.md b/eBPF.md index c7c9c21..db101ff 100644 --- a/eBPF.md +++ b/eBPF.md @@ -158,6 +158,8 @@ Opcode | Mnemonic | Pseudocode ## Branch Instructions +### 64-bit + Opcode | Mnemonic | Pseudocode -------|---------------------|------------------------ 0x05 | ja +off | PC += off @@ -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)