Commit 0fd1fd0
riscv, bpf: Factor out emit_call for kernel and bpf context
The current emit_call function is not suitable for kernel function call as
it store return value to bpf R0 register. We can separate it out for common
use. Meanwhile, simplify judgment logic, that is, fixed function address
can use jal or auipc+jalr, while the unfixed can use only auipc+jalr.
Signed-off-by: Pu Lehui <pulehui@huawei.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Tested-by: Björn Töpel <bjorn@rivosinc.com>
Acked-by: Björn Töpel <bjorn@rivosinc.com>
Link: https://lore.kernel.org/bpf/20230215135205.1411105-3-pulehui@huaweicloud.com1 parent 5e57fb7 commit 0fd1fd0
1 file changed
Lines changed: 13 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
428 | 428 | | |
429 | 429 | | |
430 | 430 | | |
431 | | - | |
| 431 | + | |
432 | 432 | | |
433 | 433 | | |
434 | 434 | | |
435 | 435 | | |
436 | | - | |
| 436 | + | |
437 | 437 | | |
438 | 438 | | |
439 | 439 | | |
| |||
454 | 454 | | |
455 | 455 | | |
456 | 456 | | |
457 | | - | |
| 457 | + | |
458 | 458 | | |
459 | 459 | | |
460 | 460 | | |
461 | | - | |
462 | | - | |
463 | 461 | | |
464 | 462 | | |
465 | 463 | | |
466 | 464 | | |
467 | 465 | | |
468 | 466 | | |
469 | | - | |
470 | | - | |
471 | | - | |
472 | | - | |
473 | | - | |
474 | | - | |
| 467 | + | |
475 | 468 | | |
476 | 469 | | |
477 | 470 | | |
| |||
913 | 906 | | |
914 | 907 | | |
915 | 908 | | |
916 | | - | |
| 909 | + | |
917 | 910 | | |
918 | 911 | | |
919 | 912 | | |
| |||
1032 | 1025 | | |
1033 | 1026 | | |
1034 | 1027 | | |
1035 | | - | |
| 1028 | + | |
1036 | 1029 | | |
1037 | 1030 | | |
1038 | 1031 | | |
1039 | | - | |
1040 | | - | |
| 1032 | + | |
| 1033 | + | |
1041 | 1034 | | |
1042 | 1035 | | |
1043 | | - | |
| 1036 | + | |
| 1037 | + | |
1044 | 1038 | | |
1045 | 1039 | | |
| 1040 | + | |
| 1041 | + | |
1046 | 1042 | | |
1047 | 1043 | | |
1048 | 1044 | | |
| |||
1057 | 1053 | | |
1058 | 1054 | | |
1059 | 1055 | | |
1060 | | - | |
| 1056 | + | |
1061 | 1057 | | |
1062 | 1058 | | |
1063 | 1059 | | |
| |||
0 commit comments