2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-20 19:23:57 +08:00
linux-next/drivers/media/rc
Andrii Nakryiko 82e6b1eee6 bpf: Allow to specify user-provided bpf_cookie for BPF perf links
Add ability for users to specify custom u64 value (bpf_cookie) when creating
BPF link for perf_event-backed BPF programs (kprobe/uprobe, perf_event,
tracepoints).

This is useful for cases when the same BPF program is used for attaching and
processing invocation of different tracepoints/kprobes/uprobes in a generic
fashion, but such that each invocation is distinguished from each other (e.g.,
BPF program can look up additional information associated with a specific
kernel function without having to rely on function IP lookups). This enables
new use cases to be implemented simply and efficiently that previously were
possible only through code generation (and thus multiple instances of almost
identical BPF program) or compilation at runtime (BCC-style) on target hosts
(even more expensive resource-wise). For uprobes it is not even possible in
some cases to know function IP before hand (e.g., when attaching to shared
library without PID filtering, in which case base load address is not known
for a library).

This is done by storing u64 bpf_cookie in struct bpf_prog_array_item,
corresponding to each attached and run BPF program. Given cgroup BPF programs
already use two 8-byte pointers for their needs and cgroup BPF programs don't
have (yet?) support for bpf_cookie, reuse that space through union of
cgroup_storage and new bpf_cookie field.

Make it available to kprobe/tracepoint BPF programs through bpf_trace_run_ctx.
This is set by BPF_PROG_RUN_ARRAY, used by kprobe/uprobe/tracepoint BPF
program execution code, which luckily is now also split from
BPF_PROG_RUN_ARRAY_CG. This run context will be utilized by a new BPF helper
giving access to this user-provided cookie value from inside a BPF program.
Generic perf_event BPF programs will access this value from perf_event itself
through passed in BPF program context.

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Yonghong Song <yhs@fb.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/bpf/20210815070609.987780-6-andrii@kernel.org
2021-08-17 00:45:07 +02:00
..
img-ir media: fix incorrect kernel doc usages 2021-03-11 11:59:44 +01:00
keymaps media: rc: add keymap for Toshiba CT-90405 remote 2021-06-08 15:56:58 +02:00
ati_remote.c media: ati_remote: sanity check for both endpoints 2020-09-27 11:24:07 +02:00
bpf-lirc.c bpf: Allow to specify user-provided bpf_cookie for BPF perf links 2021-08-17 00:45:07 +02:00
ene_ir.c
ene_ir.h
fintek-cir.c
fintek-cir.h
gpio-ir-recv.c media: rc: gpio-ir-recv: add QoS support for cpuidle system 2020-09-27 11:27:23 +02:00
gpio-ir-tx.c
igorplugusb.c
iguanair.c
imon_raw.c
imon.c media: imon: use DEVICE_ATTR_RW() helper macro 2021-06-08 15:57:51 +02:00
ir_toy.c media: ir_toy: add another IR Droid device 2021-01-14 13:44:35 +01:00
ir-hix5hd2.c media: rc: ir-hix5hd2: use the correct HiSilicon copyright 2021-04-09 13:03:24 +02:00
ir-imon-decoder.c
ir-jvc-decoder.c
ir-mce_kbd-decoder.c media: rc: fix timeout handling after switch to microsecond durations 2021-01-11 12:58:44 +01:00
ir-nec-decoder.c
ir-rc5-decoder.c
ir-rc6-decoder.c Linux 5.9-rc4 2020-09-07 16:13:06 +02:00
ir-rcmm-decoder.c
ir-rx51.c
ir-sanyo-decoder.c
ir-sharp-decoder.c
ir-sony-decoder.c Linux 5.9-rc4 2020-09-07 16:13:06 +02:00
ir-spi.c
ir-xmp-decoder.c
ite-cir.c media: ite-cir: probe of ITE8708 on ASUS PN50 fails 2021-04-09 13:04:25 +02:00
ite-cir.h media: rc: ite-cir: replace some an EN DASH 2021-06-04 08:10:42 +02:00
Kconfig media: rc: clean up Kconfig dependencies 2021-05-21 15:06:04 +02:00
lirc_dev.c media: rc: validate that "rc_proto" is reasonable 2020-11-17 06:57:10 +01:00
Makefile media: rc: remove tango ir driver and keymap 2021-05-21 15:05:04 +02:00
mceusb.c media: mceusb: sanity check for prescaler value 2021-01-27 08:28:36 +01:00
meson-ir.c
mtk-cir.c media: mtk-cir: fix calculation of chk period 2020-12-01 16:00:51 +01:00
nuvoton-cir.c
nuvoton-cir.h
pwm-ir-tx.c
rc-core-priv.h media: rc: rename ir_lirc_* functions to lirc_* 2020-09-03 16:19:27 +02:00
rc-ir-raw.c media: rc: rename ir_lirc_* functions to lirc_* 2020-09-03 16:19:27 +02:00
rc-loopback.c
rc-main.c media: rc: compile rc-cec.c into rc-core 2021-03-11 11:40:28 +01:00
redrat3.c
serial_ir.c media: rc: fix timeout handling after switch to microsecond durations 2021-01-11 12:58:44 +01:00
sir_ir.c
st_rc.c media: st_rc: Handle errors of clk_prepare_enable() 2021-06-08 15:55:55 +02:00
streamzap.c
sunxi-cir.c media: sunxi-cir: Implement suspend/resume/shutdown callbacks 2021-01-27 08:27:59 +01:00
ttusbir.c
winbond-cir.c
xbox_remote.c