diff options
author | 2023-08-27 08:27:39 -0700 | |
---|---|---|
committer | 2023-09-08 08:42:17 -0700 | |
commit | 55db92f42fe4a4ef7b4c2b4960c6212c8512dd53 (patch) | |
tree | a2c0c5e59771d18ca0fb8e8979a821b022e8c333 /kernel/bpf/helpers.c | |
parent | bpf: Add support for non-fix-size percpu mem allocation (diff) | |
download | linux-rng-55db92f42fe4a4ef7b4c2b4960c6212c8512dd53.tar.xz linux-rng-55db92f42fe4a4ef7b4c2b4960c6212c8512dd53.zip |
bpf: Add BPF_KPTR_PERCPU as a field type
BPF_KPTR_PERCPU represents a percpu field type like below
struct val_t {
... fields ...
};
struct t {
...
struct val_t __percpu_kptr *percpu_data_ptr;
...
};
where
#define __percpu_kptr __attribute__((btf_type_tag("percpu_kptr")))
While BPF_KPTR_REF points to a trusted kernel object or a trusted
local object, BPF_KPTR_PERCPU points to a trusted local
percpu object.
This patch added basic support for BPF_KPTR_PERCPU
related to percpu_kptr field parsing, recording and free operations.
BPF_KPTR_PERCPU also supports the same map types
as BPF_KPTR_REF does.
Note that unlike a local kptr, it is possible that
a BPF_KTPR_PERCPU struct may not contain any
special fields like other kptr, bpf_spin_lock, bpf_list_head, etc.
Signed-off-by: Yonghong Song <yonghong.song@linux.dev>
Link: https://lore.kernel.org/r/20230827152739.1996391-1-yonghong.song@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'kernel/bpf/helpers.c')
0 files changed, 0 insertions, 0 deletions