diff options
| author | Daniel Borkmann <daniel@iogearbox.net> | 2026-10-13 19:12:23 +0200 |
|---|---|---|
| committer | Kumar Kartikeya Dwivedi <memxor@gmail.com> | 2026-10-15 02:40:10 +0200 |
| commit | 74309a9294a74975fee75e4d6259eef026495325 (patch) | |
| tree | aed2c9772edc51613a93e972de1d0bd91faed66f /scripts/Makefile.thinlto | |
| parent | f2a5c00a80f1457dce96397d7ce2c57968d130c5 (diff) | |
bpf, x86: Fold the PROBE_MEM address computation into a lea
The kernel address check in front of a BPF_PROBE_MEM load computed
src_reg + off - VSYSCALL_ADDR with a mov of VSYSCALL_ADDR, a mov of
the base register, an add of the offset in imm32 form and a sub, that
is 20 bytes and 4 uops. VSYSCALL_ADDR is -10 MiB, so together with
the 16-bit instruction offset it fits into a 32-bit displacement and
a single lea does the same in 7 bytes and 1 uop on Intel and AMD.
Before, for the check on r0 = *(u64 *)(r1 + 16):
49 c7 c2 00 00 60 ff movq $0xffffffffff600000,%r10
49 89 fb movq %rdi,%r11
49 81 c3 10 00 00 00 addq $0x10,%r11
4d 29 d3 subq %r10,%r11
After:
4c 8d 9f 10 00 a0 00 leaq 0xa00010(%rdi),%r11
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20261013171230.523677-12-daniel@iogearbox.net
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
