LoongArch: BPF: Enable bpf_probe_read{, str}() on LoongArch
authorChenguang Zhao <zhaochenguang@kylinos.cn>
Fri, 28 Jul 2023 02:30:42 +0000 (10:30 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Aug 2023 08:24:16 +0000 (10:24 +0200)
commit2b58bd384730ac2cd177fd8e4d0bf0aa4a0bf166
tree2cb99eef8ecf95e454d4a26bbaf4d783bb8c9117
parent8a5e0c1f71dc4a57acee3e76f0074f6b867e8611
LoongArch: BPF: Enable bpf_probe_read{, str}() on LoongArch

commit de0e30bee86d0f99c696a1fea34474e556a946ec upstream.

Currently nettrace does not work on LoongArch due to missing
bpf_probe_read{,str}() support, with the error message:

     ERROR: failed to load kprobe-based eBPF
     ERROR: failed to load kprobe-based bpf

According to commit 0ebeea8ca8a4d1d ("bpf: Restrict bpf_probe_read{,
str}() only to archs where they work"), we only need to select
CONFIG_ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE to add said support,
because LoongArch does have non-overlapping address ranges for kernel
and userspace.

Cc: stable@vger.kernel.org # 6.1
Signed-off-by: Chenguang Zhao <zhaochenguang@kylinos.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/loongarch/Kconfig