]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit - include/linux/btf.h
bpf: Allow specifying volatile type modifier for kptrs
authorKumar Kartikeya Dwivedi <memxor@gmail.com>
Thu, 3 Nov 2022 19:09:51 +0000 (00:39 +0530)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 4 Nov 2022 02:31:17 +0000 (19:31 -0700)
commit23da464dd6b8935b66f4ee306ad8947fd32ccd75
treec6374961daa5a9d76af819da69d114d628ca30ee
parent9805af8d8a5b17f9ea0a16f636f3440b970049f3
bpf: Allow specifying volatile type modifier for kptrs

This is useful in particular to mark the pointer as volatile, so that
compiler treats each load and store to the field as a volatile access.
The alternative is having to define and use READ_ONCE and WRITE_ONCE in
the BPF program.

Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Acked-by: David Vernet <void@manifault.com>
Link: https://lore.kernel.org/r/20221103191013.1236066-3-memxor@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
include/linux/btf.h
kernel/bpf/btf.c