On Thu, May 26, 2022 at 11:55 AM Yonghong Song <yhs@xxxxxx> wrote: > > When old kernel does not support enum64 but user space btf > contains non-zero enum kflag or enum64, libbpf needs to > do proper sanitization so modified btf can be accepted > by the kernel. > > Sanitization for enum kflag can be achieved by clearing > the kflag bit. For enum64, the type is replaced with an > union of integer member types and the integer member size > must be smaller than enum64 size. If such an integer > type cannot be found, a new type is created and used > for union members. > > Signed-off-by: Yonghong Song <yhs@xxxxxx> > --- LGTM! Acked-by: Andrii Nakryiko <andrii@xxxxxxxxxx> > tools/lib/bpf/btf.h | 3 +- > tools/lib/bpf/libbpf.c | 56 ++++++++++++++++++++++++++++++--- > tools/lib/bpf/libbpf_internal.h | 2 ++ > 3 files changed, 56 insertions(+), 5 deletions(-) > [...]