rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Danilo Krummrich <dakr@kernel.org>
To: Alexandre Courbot <acourbot@nvidia.com>
Cc: "Greg KH" <gregkh@linuxfoundation.org>,
	"John Hubbard" <jhubbard@nvidia.com>,
	"Timur Tabi" <timur@kernel.org>,
	"Miguel Ojeda" <ojeda@kernel.org>,
	"Alex Gaynor" <alex.gaynor@gmail.com>,
	"Boqun Feng" <boqun.feng@gmail.com>,
	"Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <benno.lossin@proton.me>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Trevor Gross" <tmgross@umich.edu>,
	linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org
Subject: Re: [PATCH] rust: add basic ELF sections parser
Date: Fri, 16 May 2025 18:01:15 +0200	[thread overview]
Message-ID: <aCdhS10JCh6HRpqV@pollux> (raw)
In-Reply-To: <D9XNS413TVXB.3SWWJE4JGEN8B@nvidia.com>

On Fri, May 16, 2025 at 11:35:42PM +0900, Alexandre Courbot wrote:
> On Fri May 16, 2025 at 10:35 PM JST, Danilo Krummrich wrote:
> > I think we should either we get to the conclusion that the desire of parsing (at
> > least part of) the firmware ELF is valid in the kernel and make it generic
> > infrastructure, or conclude that there really isn't a reasonable technical
> > reason to do that.
> >
> > Please let's work out the exact technical reasons for doing this in the kernel,
> > such that we can either conclude one or the other.
> 
> I think it's mostly a matter of where we want to draw the line.
> 
> We use ELF as a container format to associate binary blobs with named
> sections. Can we extract these sections into individual files that we
> load using request_firmware()? Why yes, we could.
> 
> Now the GSP firmware for GA102 contains the following sections (skipped
> the ones that don't need to be extracted):
> 
>   [ 1] .fwimage          PROGBITS         0000000000000000  00000040
>   [ 2] .fwversion        PROGBITS         0000000000000000  02448040
>   [ 3] .fwsignature[...] PROGBITS         0000000000000000  0244804b
>   [ 4] .fwsignature[...] PROGBITS         0000000000000000  0244904b
>   [ 5] .fwsignature[...] PROGBITS         0000000000000000  0244a04b
>   [ 6] .fwsignature[...] PROGBITS         0000000000000000  0244b04b
> 
> That's 6 files instead of 1, for serving the same purpose. And the number of
> signatures is bound to *increase* as new chips get released, but since they are
> associated to chipsets, we can maybe limit them to the relevant chipset
> directory and limit the damage. Still it would clutter linux-firmware a bit
> more than it is today.
> 
> But let's say we do this, and problem solved. Only... let's take a look at the
> booter binary, which is another innocent-looking firmware file.
> 
> It includes a header with offsets to the code and data segments, that the
> driver loads into the falcon microcontroller. And one offset for the signatures
> that we need to patch. Reminds you of something? :) Should we split these ones
> too?
> 
> I would push back really hard on that one, unless you agree to go after all the
> drivers that do the same thing (and I have names).

Great, but then why did you back off in your discussion with Greg? Given that
you are convinced that this is a valid thing to do for drivers, you should keep
discussing it with the target to make it common infrastructure.

I did not argue for or against it -- what I do disagree with is that we seem to
just agree to disagree and stuff a generic piece of code into nova-core after
three mails back and forth.

Please keep discussing the above with Greg until we get to a real conclusion.

- Danilo

  reply	other threads:[~2025-05-16 16:01 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-15  6:03 [PATCH] rust: add basic ELF sections parser Alexandre Courbot
2025-05-15  7:38 ` Greg KH
2025-05-15  8:32   ` Alexandre Courbot
2025-05-15 11:25     ` Alexandre Courbot
2025-05-15 11:42       ` Greg KH
2025-05-15 13:09         ` Alexandre Courbot
2025-05-15 14:30         ` Timur Tabi
2025-05-15 19:17           ` John Hubbard
2025-05-16 13:15             ` Greg KH
2025-05-16 13:26               ` Alexandre Courbot
2025-05-16 13:32                 ` Greg KH
2025-05-16 13:35                 ` Danilo Krummrich
2025-05-16 14:35                   ` Alexandre Courbot
2025-05-16 16:01                     ` Danilo Krummrich [this message]
2025-05-16 19:00                       ` John Hubbard
2025-05-17 10:13                         ` Danilo Krummrich
2025-05-17 13:41                           ` Alexandre Courbot
2025-05-16 16:28                     ` Timur Tabi
2025-05-17  0:51                       ` Alexandre Courbot
2025-05-29  6:53                         ` Alexandre Courbot
2025-05-29  8:01                           ` Greg KH
2025-05-30  0:58                             ` Alexandre Courbot
2025-05-30  6:21                               ` Greg KH
2025-05-30  6:56                                 ` Alexandre Courbot
2025-05-30  9:00                                   ` Greg KH
2025-05-30  6:22                               ` Greg KH
2025-05-30  6:59                                 ` Alexandre Courbot
2025-05-30  9:01                                   ` Greg KH
2025-05-30 14:34                                     ` Alexandre Courbot
2025-05-30 15:42                                       ` Greg KH
2025-05-30 18:10                                         ` Timur Tabi
2025-05-31  5:45                                           ` Greg KH
2025-05-31 10:17                                             ` Timur Tabi
2025-05-31 12:25                                               ` Greg KH
2025-05-31 14:38                                                 ` Timur Tabi
2025-05-31 15:28                                                   ` Danilo Krummrich
2025-06-01  7:48                                                   ` Greg KH
2025-05-31 12:33                                             ` Alexandre Courbot
2025-05-31 13:30                                               ` Greg KH
2025-06-01 12:23                                                 ` Alexandre Courbot
2025-06-13  3:32                                                 ` Alexandre Courbot
2025-06-24 14:26                                                   ` Greg KH
2025-06-24 14:51                                                     ` Danilo Krummrich

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=aCdhS10JCh6HRpqV@pollux \
    --to=dakr@kernel.org \
    --cc=a.hindborg@kernel.org \
    --cc=acourbot@nvidia.com \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=benno.lossin@proton.me \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=gary@garyguo.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=jhubbard@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=timur@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;
as well as URLs for NNTP newsgroup(s).