Commit 373f2f4
bpf,x86: adjust the "jmp" mode for bpf trampoline
In the origin call case, if BPF_TRAMP_F_SKIP_FRAME is not set, it means
that the trampoline is not called, but "jmp".
Introduce the function bpf_trampoline_use_jmp() to check if the trampoline
is in "jmp" mode.
Do some adjustment on the "jmp" mode for the x86_64. The main adjustment
that we make is for the stack parameter passing case, as the stack
alignment logic changes in the "jmp" mode without the "rip". What's more,
the location of the parameters on the stack also changes.
Signed-off-by: Menglong Dong <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexei Starovoitov <[email protected]>1 parent 47c9214 commit 373f2f4
2 files changed
+23
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2847 | 2847 | | |
2848 | 2848 | | |
2849 | 2849 | | |
2850 | | - | |
| 2850 | + | |
2851 | 2851 | | |
2852 | 2852 | | |
| 2853 | + | |
2853 | 2854 | | |
2854 | 2855 | | |
2855 | 2856 | | |
| |||
2890 | 2891 | | |
2891 | 2892 | | |
2892 | 2893 | | |
2893 | | - | |
| 2894 | + | |
2894 | 2895 | | |
2895 | 2896 | | |
2896 | 2897 | | |
| |||
3284 | 3285 | | |
3285 | 3286 | | |
3286 | 3287 | | |
3287 | | - | |
| 3288 | + | |
| 3289 | + | |
| 3290 | + | |
| 3291 | + | |
| 3292 | + | |
| 3293 | + | |
3288 | 3294 | | |
3289 | 3295 | | |
3290 | 3296 | | |
| |||
3344 | 3350 | | |
3345 | 3351 | | |
3346 | 3352 | | |
3347 | | - | |
| 3353 | + | |
3348 | 3354 | | |
3349 | 3355 | | |
3350 | 3356 | | |
| |||
3377 | 3383 | | |
3378 | 3384 | | |
3379 | 3385 | | |
3380 | | - | |
| 3386 | + | |
3381 | 3387 | | |
3382 | 3388 | | |
3383 | 3389 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1264 | 1264 | | |
1265 | 1265 | | |
1266 | 1266 | | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
1267 | 1279 | | |
1268 | 1280 | | |
1269 | 1281 | | |
| |||
0 commit comments