public inbox for rust-for-linux@vger.kernel.org
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Gary Guo <gary@garyguo.net>
Cc: "Alexandre Courbot" <acourbot@nvidia.com>,
	"Gary Guo" <gary@kernel.org>, "Miguel Ojeda" <ojeda@kernel.org>,
	"Boqun Feng" <boqun.feng@gmail.com>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <lossin@kernel.org>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Danilo Krummrich" <dakr@kernel.org>,
	"Nicolas Schier" <nsc@kernel.org>,
	"Thomas Weißschuh" <linux@weissschuh.net>,
	"Masahiro Yamada" <masahiroy@kernel.org>,
	"Kees Cook" <kees@kernel.org>,
	rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 2/2] kbuild: rust: use klint to provide CONFIG_FRAME_WARN
Date: Wed, 28 Jan 2026 15:02:17 -0700	[thread overview]
Message-ID: <20260128220217.GA2129077@ax162> (raw)
In-Reply-To: <DFZTOMSDPOQM.3QW4TZ52N4MKZ@garyguo.net>

On Wed, Jan 28, 2026 at 01:14:27AM +0000, Gary Guo wrote:
> It might be possible to do more detailed analysis by checking what is using the
> stack (e.g. perhaps recovery variable -> stack slots using DWARF if full
> debuginfo is enabled, or find out the instruction that first touches the

Yeah Nick wrote a Python script to use debug info to give a better idea
of stack usage to help us debug these warnings from clang:

  https://github.com/ClangBuiltLinux/frame-larger-than

It is rather hacky and feels like there are a number of corner cases
where things don't look quite right but it is better than nothing.

> specific stack location and map it back like that), but doing so is quite tricky
> and the marginal benefit is less than pointing out there's an issue to be
> investigated in the first place.

Does Rust have the equivalent of '-Rpass-analysis' from clang? There was
'-Rpass-analysis=stack-frame-layout' that was added in LLVM 16:

  https://github.com/llvm/llvm-project/commit/557a5bc336ffb9b03c53d4d13fd8f0bc9418ec96

I assume that could be used from Rust as well since it is in the LLVM
backend? It does not necessarily show exactly where the stack usage
comes from aside from variables and spills but still, some information
(especially accurate information at this level) is better than nothing.

Cheers,
Nathan

  reply	other threads:[~2026-01-28 22:02 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-27 17:11 [RFC PATCH 0/2] Initial klint integration Gary Guo
2026-01-27 17:11 ` [RFC PATCH 1/2] kbuild: rust: register "klint" as a tool Gary Guo
2026-01-27 17:11 ` [RFC PATCH 2/2] kbuild: rust: use klint to provide CONFIG_FRAME_WARN Gary Guo
2026-01-27 22:15   ` Nathan Chancellor
2026-01-27 22:51     ` Gary Guo
2026-01-27 23:12       ` Miguel Ojeda
2026-01-27 23:27         ` Gary Guo
2026-01-28  0:31   ` Alexandre Courbot
2026-01-28  1:14     ` Gary Guo
2026-01-28 22:02       ` Nathan Chancellor [this message]
2026-01-29  0:59         ` Gary Guo
2026-01-30  4:10           ` Nathan Chancellor
2026-01-27 17:35 ` [RFC PATCH 0/2] Initial klint integration Miguel Ojeda
2026-01-27 17:47 ` Danilo Krummrich
2026-01-27 21:26 ` John Hubbard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260128220217.GA2129077@ax162 \
    --to=nathan@kernel.org \
    --cc=a.hindborg@kernel.org \
    --cc=acourbot@nvidia.com \
    --cc=aliceryhl@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=dakr@kernel.org \
    --cc=gary@garyguo.net \
    --cc=gary@kernel.org \
    --cc=kees@kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@weissschuh.net \
    --cc=lossin@kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=nsc@kernel.org \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tmgross@umich.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox