diff options
author | Martin KaFai Lau <[email protected]> | 2018-04-18 15:56:02 -0700 |
---|---|---|
committer | Daniel Borkmann <[email protected]> | 2018-04-19 21:46:25 +0200 |
commit | 60197cfb6e11ffc03aa0ed23765b2f7e70b2e2d4 (patch) | |
tree | ce07ea8aa1bcf4a3c989d8a974a4413a97308c80 /drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | |
parent | f56a653c1fd13a197076dec4461c656fd2adec73 (diff) |
bpf: btf: Add BPF_OBJ_GET_INFO_BY_FD support to BTF fd
This patch adds BPF_OBJ_GET_INFO_BY_FD support to BTF fd.
The original BTF data, which was used to create the BTF fd during
the earlier BPF_BTF_LOAD call, will be returned.
The userspace is expected to allocate buffer
to info.info and the buffer size is set to info.info_len before
calling BPF_OBJ_GET_INFO_BY_FD.
The original BTF data is copied to the userspace buffer (info.info).
Only upto the user's specified info.info_len will be copied.
The original BTF data size is set to info.info_len. The userspace
needs to check if it is bigger than its allocated buffer size.
If it is, the userspace should realloc with the kernel-returned
info.info_len and call the BPF_OBJ_GET_INFO_BY_FD again.
Signed-off-by: Martin KaFai Lau <[email protected]>
Acked-by: Alexei Starovoitov <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c')
0 files changed, 0 insertions, 0 deletions