]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
MIPS/bpf: Enable bpf_probe_read{, str}() on MIPS again
authorTiezhu Yang <yangtiezhu@loongson.cn>
Thu, 25 Mar 2021 12:50:01 +0000 (20:50 +0800)
committerKelsey Skunberg <kelsey.skunberg@canonical.com>
Mon, 24 May 2021 23:46:34 +0000 (17:46 -0600)
commit45e1188a592628ccd3582ce9eca954b374996d82
treefc869b0b380408fff2eb3fda14a4bb21d9a07e82
parent1389c9b99a291dd129fc2e2d95cd261ad3389a92
MIPS/bpf: Enable bpf_probe_read{, str}() on MIPS again

BugLink: https://bugs.launchpad.net/bugs/1929455
[ Upstream commit 66633abd0642f1e89d26e15f36fb13d3a1c535ff ]

After commit 0ebeea8ca8a4 ("bpf: Restrict bpf_probe_read{, str}() only to
archs where they work"), bpf_probe_read{, str}() functions were no longer
available on MIPS, so there exist some errors when running bpf program:

root@linux:/home/loongson/bcc# python examples/tracing/task_switch.py
bpf: Failed to load program: Invalid argument
[...]
11: (85) call bpf_probe_read#4
unknown func bpf_probe_read#4
[...]
Exception: Failed to load BPF program count_sched: Invalid argument

ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE should be restricted to archs
with non-overlapping address ranges, but they can overlap in EVA mode
on MIPS, so select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE if !EVA in
arch/mips/Kconfig, otherwise the bpf old helper bpf_probe_read() will
not be available.

This is similar with the commit d195b1d1d119 ("powerpc/bpf: Enable
bpf_probe_read{, str}() on powerpc again").

Fixes: 0ebeea8ca8a4 ("bpf: Restrict bpf_probe_read{, str}() only to archs where they work")
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
arch/mips/Kconfig