Re: [PATCH v5 02/12] gpu: nova-core: move GSP boot code to a dedicated method

Joel Fernandes
2025-09-13T21:16:38Z

Hi Miguel,

On Sat, Sep 13, 2025 at 10:37:34PM +0200, Miguel Ojeda wrote:
> On Sat, Sep 13, 2025 at 7:14 PM Joel Fernandes <joelagnelf@nvidia.com> wrote:
> >
> > I am not alone in that opinion.
>
> Hmm... I am not sure how to read this.

I don't follow? I am just saying that pinning seems to be a rather odd thing
to do explictly that we don't in other languages. I know why Rust needs it,
but it is even more strange that Rust requires additional macros in the
kernel to further implement features required for it, when it probably should
been a part of the language design from the beginning (and not require
changes to macros to support usecases, like we saw for Nova).

It is possible that I don't fully understand pinning - but what I do
understand (and please correct me if I'm wrong), pinning is required mainly
because Rust default-moves data which wreaks havoc for stuff that unsafe code
(C code) exposes (spinlocks for example) or data hardware expects to be at
fixed locations. This also arises because of mixing unsafe code, with safe
code. So it is required mainly because Unsafe code (and hardware) does not
break, due to "safe" Rust's default movement. Is my understanding wrong?

> > This should be first-class in a (systems) language, built into
> > the language itself?
>
> I would suggest taking a look at our website and the links there (like
> issue #2) -- what we are doing upstream Rust is documented.

Sure, thanks for the pointers, I will study them further.

> (Danilo gave you a direct link, but I mention it this way because
> there are a lot of things going on, and it is worth a look and perhaps
> you may find something interesting you could help with).

Sure, thanks.

> > except to satisfy paranoia
>
> Using unsafe code everywhere (or introducing unsoundness or UB for
> convenience) would defeat much of the Rust for Linux exercise.

Where in the thread did I suggest that, though? (using unsafe everywhere).

Also note, I'm pretty much a Rust (and Rust 4 linux) newbie and don't claim
to be any kind of expert in these. But I have studied Rust for about a year
now and pinning for a few months :). I don't mean to make noise, just
discussing so I can learn more and help in some way :) Please don't be too
offended by my ramblings.

thanks,

- Joel