Commit 6562472
asm: add support for the may_goto insn and JCOND opcode
The `may_goto` instruction is a bit special and relatively new, from
March 2024, added by 011832b97b31 ("bpf: Introduce may_goto
instruction")[^1]. It uses the `BPF_JCOND` opcode `0xe0` with the source
register being `BPF_MAY_GOTO = 0`. Note that this instruction is not
documented in the latest instruction set kernel documentation[^2].
As I understand, the goal of this instruction is to be injected in loops
(also potentially by LLVM) to offload the verifier responsibility of
loop verification to a runtime check. The runtime check being
decrementing a counter so far.
[^1]: https://lore.kernel.org/bpf/20240306031929.42666-2-alexei.starovoitov@gmail.com
[^2]: https://www.kernel.org/doc/html/v6.17/bpf/standardization/instruction-set.html#jump-instructions
Co-Authored-By: Mahe Tardy <mahe.tardy@gmail.com>
Signed-off-by: Dylan Reimerink <dylan.reimerink@isovalent.com>1 parent dd42f89 commit 6562472
File tree
6 files changed
+22
-3
lines changed- asm
6 files changed
+22
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
396 | 396 | | |
397 | 397 | | |
398 | 398 | | |
399 | | - | |
400 | 399 | | |
401 | 400 | | |
| 401 | + | |
402 | 402 | | |
403 | 403 | | |
404 | 404 | | |
| |||
411 | 411 | | |
412 | 412 | | |
413 | 413 | | |
| 414 | + | |
414 | 415 | | |
415 | 416 | | |
416 | 417 | | |
417 | 418 | | |
418 | 419 | | |
419 | 420 | | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
420 | 429 | | |
| 430 | + | |
421 | 431 | | |
422 | 432 | | |
423 | 433 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
393 | 393 | | |
394 | 394 | | |
395 | 395 | | |
| 396 | + | |
| 397 | + | |
396 | 398 | | |
397 | 399 | | |
398 | 400 | | |
| |||
427 | 429 | | |
428 | 430 | | |
429 | 431 | | |
| 432 | + | |
430 | 433 | | |
431 | 434 | | |
432 | 435 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| 48 | + | |
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| |||
0 commit comments