]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: Avoid reload of imm for weak, unresolved, repeating ksym
authorKumar Kartikeya Dwivedi <memxor@gmail.com>
Mon, 22 Nov 2021 23:57:33 +0000 (05:27 +0530)
committerAndrii Nakryiko <andrii@kernel.org>
Tue, 30 Nov 2021 23:48:15 +0000 (15:48 -0800)
commit8befdf94a1d0a5e86d7f8899745c4b9801c911d1
treef9e3218358a518f12f76acc5765fd6af95ef4cbd
parent9d23e246437903148d81c8a261f130dfca7056aa
libbpf: Avoid reload of imm for weak, unresolved, repeating ksym

Alexei pointed out that we can use BPF_REG_0 which already contains imm
from move_blob2blob computation. Note that we now compare the second
insn's imm, but this should not matter, since both will be zeroed out
for the error case for the insn populated earlier.

Suggested-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Song Liu <songliubraving@fb.com>
Link: https://lore.kernel.org/bpf/20211122235733.634914-4-memxor@gmail.com
tools/lib/bpf/gen_loader.c