[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+icZUUjy5cR5cq6PqSA0+KDsovqAx-zH9CozH8TpETu9jYYPw@mail.gmail.com>
Date: Sat, 6 Feb 2021 11:23:52 +0100
From: Sedat Dilek <sedat.dilek@...il.com>
To: Yonghong Song <yhs@...com>
Cc: Masahiro Yamada <masahiroy@...nel.org>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Arnaldo Carvalho de Melo <arnaldo.melo@...il.com>,
dwarves@...r.kernel.org,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
bpf@...r.kernel.org, Jiri Olsa <jolsa@...nel.org>,
Jan Engelhardt <jengelh@...i.de>,
Domenico Andreoli <cavok@...ian.org>,
Matthias Schwarzott <zzam@...too.org>,
Andrii Nakryiko <andriin@...com>,
Mark Wieelard <mjw@...hat.com>,
Paul Moore <paul@...l-moore.com>,
Ondrej Mosnacek <omosnace@...hat.com>,
Daniel P. Berrangé <berrange@...hat.com>,
Tom Stellard <tstellar@...hat.com>
Subject: Re: ERROR: INT DW_ATE_unsigned_1 Error emitting BTF type
[ SNIP ]
> > > > > Please help do a test. I can submit a formal patch tomorrow.
> > > >
> > > > Thanks for the patch.
> > > >
> > > > Can you attach the diff as Gmail has totally truncated/malformed it?
> > > >
> > > > For the Linux breakage - you will need some additional Clang specific patches.
> > > > Is this Linux 5.11-rcX?
> > > > The "Blocking bugs" are listed in the first post of "Linux 5.11 release cycle".
> > > > Hope this helps.
> > > >
> > > > This is cool co-working :-).
> > > >
> > > > - Sedat -
> > > >
> > > > [1] https://github.com/ClangBuiltLinux/linux/issues/1228
> > >
> > > With the attached diff and new selfmade pahole looks good here.
> > >
> > > Passed (see line-numbers):
> > >
> > > 11090:+ info LD .tmp_vmlinux.btf
> > > 11099:+ info BTF .btf.vmlinux.bin.o
> > > 11103:+ LLVM_OBJCOPY=llvm-objcopy /opt/pahole/bin/pahole -J .tmp_vmlinux.btf
> > > 11121:+ info LD .tmp_vmlinux.kallsyms1
> > > 11139:+ info KSYMS .tmp_vmlinux.kallsyms1.S
> > > 11145:+ info AS .tmp_vmlinux.kallsyms1.S
> > > 11160:+ info LD .tmp_vmlinux.kallsyms2
> > > 11178:+ info KSYMS .tmp_vmlinux.kallsyms2.S
> > > 11184:+ info AS .tmp_vmlinux.kallsyms2.S
> > > 11200:+ info LD vmlinux
> > > 11210:+ info BTFIDS vmlinux
> > > 11216:+ info SORTTAB vmlinux
> > >
> > > Still building linux-kernel...
> > >
> > > Will report later if I was able to boot on bare metal.
> > >
> >
> > When running scripts/Makefile.modfinal:
> >
> > ...
> > not supported bit_size 160
> > Encountered error while encoding BTF.
> > ...
> > make[5]: *** [scripts/Makefile.modfinal:59:
> > drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.ko] Error 1
> > make[5]: *** Deleting file
> > 'drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.ko'
> >
>
> I added "bit_size 160" to libbtf.c:
>
> static int bits_to_int_bytes(uint16_t bit_size)
> {
> if (bit_size <= 8)
> return 1;
> if (bit_size <= 16)
> return 2;
> if (bit_size <= 32)
> return 4;
> if (bit_size <= 64)
> return 8;
> if (bit_size <= 128)
> return 16;
> if (bit_size <= 160)
> return 20;
> /* BTF supports upto 16byte int (__int128). */
> return -1;
> }
>
> It still breaks with:
>
> [521367] INT DW_ATE_unsigned_160 Error emitting BTF type
> Encountered error while encoding BTF.
> make[5]: *** [scripts/Makefile.modfinal:58:
> drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.ko] Error 1
> make[5]: *** Deleting file
> 'drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.ko'
>
> Comments?
>
Indeed there is DW_ATE_unsigned_160:
$ /opt/llvm-toolchain/bin/llvm-dwarfdump
drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.o | grep DW_AT_name
| grep DW_ATE_ | sort -u
DW_AT_name ("DW_ATE_signed_32")
DW_AT_name ("DW_ATE_signed_64")
DW_AT_name ("DW_ATE_unsigned_1")
DW_AT_name ("DW_ATE_unsigned_128")
DW_AT_name ("DW_ATE_unsigned_16")
DW_AT_name ("DW_ATE_unsigned_160")
DW_AT_name ("DW_ATE_unsigned_32")
DW_AT_name ("DW_ATE_unsigned_64")
DW_AT_name ("DW_ATE_unsigned_8")
Attached is diff v2 with the "bit_size 160" fix.
- Sedat -
View attachment "DW_ATE_unsigned_1-pahole_1_20-dileks-v2.diff" of type "text/x-patch" (2439 bytes)
Powered by blists - more mailing lists