[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z4E0rZmHFU01umqx@x1>
Date: Fri, 10 Jan 2025 11:54:37 -0300
From: Arnaldo Carvalho de Melo <acme@...nel.org>
To: Matthew Maurer <mmaurer@...gle.com>
Cc: Tamir Duberstein <tamird@...il.com>, Alice Ryhl <aliceryhl@...gle.com>,
Neal Gompa <neal@...pa.dev>,
Miguel Ojeda <miguel.ojeda.sandonis@...il.com>,
Miguel Ojeda <ojeda@...nel.org>,
Alex Gaynor <alex.gaynor@...il.com>,
Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <benno.lossin@...ton.me>,
Andreas Hindborg <a.hindborg@...nel.org>,
Trevor Gross <tmgross@...ch.edu>, linux-kernel@...r.kernel.org,
rust-for-linux@...r.kernel.org,
Matthias Maennich <maennich@...gle.com>, bpf <bpf@...r.kernel.org>,
Martin KaFai Lau <martin.lau@...ux.dev>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Andrii Nakryiko <andrii@...nel.org>,
John Fastabend <john.fastabend@...il.com>,
Eric Curtin <ecurtin@...hat.com>,
Martin Reboredo <yakoyoku@...il.com>,
Alessandro Decina <alessandro.d@...il.com>,
Michal Rostecki <vadorovsky@...tonmail.com>,
Dave Tucker <dave@...cker.co.uk>
Subject: Re: [PATCH] rust: Disallow BTF generation with Rust + LTO
On Thu, Jan 09, 2025 at 02:41:50PM -0800, Matthew Maurer wrote:
> Doing a little more digging, I've also found that the latest version
> of `pahole` doesn't seem to conflict with LTO in my test builds - it
> seems to successfully filter out the Rust types. Version 1.25 was
> causing the errors that got reported to me and I was able to
> reproduce.
Right, I recall now that this multi-lang mixup of DWARF tags theory came
up in the past and IIRC were fixed by:
commit b98565e7b17ec24daeb0b17f8f403c263dfcbd36
Author: Arnaldo Carvalho de Melo <acme@...hat.com>
Date: Tue Oct 1 14:57:25 2024 -0300
dwarf_loader: Honour --lang_exclude when merging LTO built CUs
When building kernels with clang, thin-LTO, the Rust DWARF tags were
being added, which causes confusion as there has not been a concerted
effort to check if what is being generated is useful/valid.
At least the Rust DWARF tags, when converted to BTF, were not causing
crashes, which is a good signal.
Fix it by passing a 'struct cu' with all fields zeroed except for the
CU name and its language code. This is enough for the existing filter,
in pahole (cu__filter) and will also allow us to, in verbose mode, show
the CU names being filtered.
Reported-by: Tom Stellard <tstellar@...hat.com>
Cc: Alan Maguire <alan.maguire@...cle.com>
Cc: Don Zickus <dzickus@...hat.com>
Cc: Josh Stone <jistone@...hat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
So there was a mixup, but not in the DWARF data, but in the way pahole
processes LTO built CUs, combining then into one to resolve inter CU tag
references, by not filtering the Rust CUs.
But as the message there mentions, it would be good to process tags that
are valid as BTF while "voiding", i.e. filtering the ones that are not,
I'll try to continue experimenting with it as reported in this thread,
this way we could stop using lang_exclude and have some degree of Rust
BTF support that could maybe be useful to some use cases, who knows.
- Arnaldo
Powered by blists - more mailing lists