[PATCH bpf v2] riscv, bpf: fix patch_text implicit declaration

Björn Töpel bjorn at kernel.org
Sun Feb 26 23:31:01 PST 2023


Randy Dunlap <rdunlap at infradead.org> writes:

> bpf_jit_comp64.c uses patch_text(), so add <asm/patch.h> to it
> to prevent the build error:
>
> ../arch/riscv/net/bpf_jit_comp64.c: In function 'bpf_arch_text_poke':
> ../arch/riscv/net/bpf_jit_comp64.c:691:23: error: implicit declaration of function 'patch_text'; did you mean 'path_get'? [-Werror=implicit-function-declaration]
>   691 |                 ret = patch_text(ip, new_insns, ninsns);
>       |                       ^~~~~~~~~~
>
> Fixes: 596f2e6f9cf4 ("riscv, bpf: Add bpf_arch_text_poke support for RV64")
> Signed-off-by: Randy Dunlap <rdunlap at infradead.org>
> Reported-by: kernel test robot <lkp at intel.com>
> Link: https://lore.kernel.org/r/202302271000.Aj4nMXbZ-lkp@intel.com
> Cc: Pu Lehui <pulehui at huawei.com>
> Cc: Luke Nelson <luke.r.nels at gmail.com>
> Cc: Xi Wang <xi.wang at gmail.com>
> Cc: bpf at vger.kernel.org
> Cc: Alexei Starovoitov <ast at kernel.org>
> Cc: Daniel Borkmann <daniel at iogearbox.net>
> Cc: John Fastabend <john.fastabend at gmail.com>
> Cc: Andrii Nakryiko <andrii at kernel.org>
> Cc: Paul Walmsley <paul.walmsley at sifive.com>
> Cc: Palmer Dabbelt <palmer at dabbelt.com>
> Cc: Albert Ou <aou at eecs.berkeley.edu>
> Cc: "Björn Töpel" <bjorn at kernel.org>
> Cc: linux-riscv at lists.infradead.org
> ---
> v2: add header file directly to bpf_jit_comp64.c (Pu Lehui)
>     change patch target to bpf (for fixes)

Thanks, Randy!

For the curious; The asm/patch.h file was picked via UPROBES (via
PERF_EVENTS=y). For PERF_EVENTS=n, you get the build error.


Acked-by: Björn Töpel <bjorn at rivosinc.com>



More information about the linux-riscv mailing list