lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <DCPYZSLUJGZ1.2D835NAHYEM5U@nvidia.com>
Date: Thu, 11 Sep 2025 21:29:32 +0900
From: "Alexandre Courbot" <acourbot@...dia.com>
To: "Danilo Krummrich" <dakr@...nel.org>, "Alexandre Courbot"
 <acourbot@...dia.com>
Cc: "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" <lossin@...nel.org>, "Andreas
 Hindborg" <a.hindborg@...nel.org>, "Alice Ryhl" <aliceryhl@...gle.com>,
 "Trevor Gross" <tmgross@...ch.edu>, "David Airlie" <airlied@...il.com>,
 "Simona Vetter" <simona@...ll.ch>, "Maarten Lankhorst"
 <maarten.lankhorst@...ux.intel.com>, "Maxime Ripard" <mripard@...nel.org>,
 "Thomas Zimmermann" <tzimmermann@...e.de>, "John Hubbard"
 <jhubbard@...dia.com>, "Alistair Popple" <apopple@...dia.com>, "Joel
 Fernandes" <joelagnelf@...dia.com>, "Timur Tabi" <ttabi@...dia.com>,
 <rust-for-linux@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
 <nouveau@...ts.freedesktop.org>, <dri-devel@...ts.freedesktop.org>
Subject: Re: [PATCH v5 08/12] gpu: nova-core: firmware: process and prepare
 the GSP firmware

On Thu Sep 11, 2025 at 8:27 PM JST, Danilo Krummrich wrote:
> On 9/11/25 1:04 PM, Alexandre Courbot wrote:
>> diff --git a/drivers/gpu/nova-core/gpu.rs b/drivers/gpu/nova-core/gpu.rs
>> index 06a7ee8f4195759fb55ad483852724bb1ab46793..8505ee81c43e7628d1f099aff285244f8908c633 100644
>> --- a/drivers/gpu/nova-core/gpu.rs
>> +++ b/drivers/gpu/nova-core/gpu.rs
>> @@ -8,6 +8,7 @@
>>  use crate::fb::SysmemFlush;
>>  use crate::firmware::booter::{BooterFirmware, BooterKind};
>>  use crate::firmware::fwsec::{FwsecCommand, FwsecFirmware};
>> +use crate::firmware::gsp::GspFirmware;
>>  use crate::firmware::{Firmware, FIRMWARE_VERSION};
>>  use crate::gfw;
>>  use crate::regs;
>> @@ -285,6 +286,11 @@ pub(crate) fn start_gsp(
>>  
>>          let bios = Vbios::new(dev, bar)?;
>>  
>> +        let _gsp_fw = KBox::pin_init(
>> +            GspFirmware::new(dev, chipset, FIRMWARE_VERSION)?,
>> +            GFP_KERNEL,
>> +        )?;
>
> Since we now have the infrastructure in place and the change is trival, I'd
> prefer to make this a member of struct Gsp and make it part of the Gpu structure
> directly (without separate allocation).
>
> Should we need dynamic dispatch in the future, it's also trivial to make it its
> own allocation again, but maybe we also get around the dyn dispatch. :)

Ah, my previous talk about dynamic dispatch is a bit obsolete now that
the `Firmware` struct is gone. :) Sorry if that created confusion.

Truth is, this object is not supposed to survive `start_gsp`, and we can
dispose of it after the GSP is started as the bootloader will have
validated and copied it into the WPR region. So we don't want to store
it into `Gpu`, now or ever.

I guess we could technically store it on the stack, but IIRC I haven't
found a pin initializer for that in the kernel. And the structure might
be a little bit too big for that (several owned SGTables and a couple of
CoherentAllocations - we're talking hundreds of bytes).

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ