From: John Hubbard <jhubbard@nvidia.com>
To: Timur Tabi <ttabi@nvidia.com>,
Alexandre Courbot <acourbot@nvidia.com>,
"dakr@kernel.org" <dakr@kernel.org>
Cc: "aliceryhl@google.com" <aliceryhl@google.com>,
"lossin@kernel.org" <lossin@kernel.org>,
"a.hindborg@kernel.org" <a.hindborg@kernel.org>,
"boqun.feng@gmail.com" <boqun.feng@gmail.com>,
Zhi Wang <zhiw@nvidia.com>, "simona@ffwll.ch" <simona@ffwll.ch>,
"alex.gaynor@gmail.com" <alex.gaynor@gmail.com>,
"ojeda@kernel.org" <ojeda@kernel.org>,
"tmgross@umich.edu" <tmgross@umich.edu>,
"nouveau@lists.freedesktop.org" <nouveau@lists.freedesktop.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"rust-for-linux@vger.kernel.org" <rust-for-linux@vger.kernel.org>,
"bjorn3_gh@protonmail.com" <bjorn3_gh@protonmail.com>,
Eliot Courtney <ecourtney@nvidia.com>,
"airlied@gmail.com" <airlied@gmail.com>,
Joel Fernandes <joelagnelf@nvidia.com>,
"bhelgaas@google.com" <bhelgaas@google.com>,
"gary@garyguo.net" <gary@garyguo.net>,
Alistair Popple <apopple@nvidia.com>
Subject: Re: [PATCH v3 25/30] gpu: nova-core: Hopper/Blackwell: larger WPR2 (GSP) heap
Date: Sun, 8 Feb 2026 18:05:43 -0800 [thread overview]
Message-ID: <71e90bb8-b7de-48e7-a43a-68d1e73bbe6a@nvidia.com> (raw)
In-Reply-To: <6ae11f5dc8fb4058fd4f05ec7dafd493a6df5f22.camel@nvidia.com>
On 2/6/26 11:03 AM, Timur Tabi wrote:
> On Thu, 2026-02-05 at 20:21 -0800, John Hubbard wrote:
>> + fn client_alloc_size(chipset: Chipset) -> u64 {
>> + if crate::fb::hal::fb_hal(chipset)
>> + .non_wpr_heap_size()
>> + .is_some()
>> + {
>> + GSP_FW_HEAP_PARAM_CLIENT_ALLOC_SIZE_GH100
>> + } else {
>> + u64::from(bindings::GSP_FW_HEAP_PARAM_CLIENT_ALLOC_SIZE)
>> + }
>> + .align_up(GSP_HEAP_ALIGNMENT)
>> + .unwrap_or(u64::MAX)
>
> I understand not wanting to return a Result<> for impossible situations, but I don't know if this is
> the answer. For one thing, there is no way we can allocate a heap that large.
>
> Maybe we need to have some kind of infallible align_up() variant, but in this case, I would say a
> panic is warranted.
You are right. And that agrees with Miguel Ojeda's overall philosophy
about handling this type of error, too.
I'll change it to this for the next version:
diff --git a/drivers/gpu/nova-core/gsp/fw.rs b/drivers/gpu/nova-core/gsp/fw.rs
index 0d1d9eecd77c..927bcee6a5a5 100644
--- a/drivers/gpu/nova-core/gsp/fw.rs
+++ b/drivers/gpu/nova-core/gsp/fw.rs
@@ -83,7 +83,7 @@ fn client_alloc_size(chipset: Chipset) -> u64 {
u64::from(bindings::GSP_FW_HEAP_PARAM_CLIENT_ALLOC_SIZE)
}
.align_up(GSP_HEAP_ALIGNMENT)
- .unwrap_or(u64::MAX)
+ .expect("client_alloc_size alignment overflow")
}
/// Returns the amount of memory to reserve for management purposes for a framebuffer of size
@@ -94,7 +94,7 @@ fn management_overhead(fb_size: u64) -> u64 {
u64::from(bindings::GSP_FW_HEAP_PARAM_SIZE_PER_GB_FB)
.saturating_mul(fb_size_gb)
.align_up(GSP_HEAP_ALIGNMENT)
- .unwrap_or(u64::MAX)
+ .expect("management_overhead alignment overflow")
}
}
thanks,
--
John Hubbard
next prev parent reply other threads:[~2026-02-09 2:06 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-06 4:20 [PATCH v3 00/30] gpu: nova-core: firmware: Hopper/Blackwell support John Hubbard
2026-02-06 4:20 ` [PATCH v3 01/30] gpu: nova-core: print FB sizes, along with ranges John Hubbard
2026-02-06 4:20 ` [PATCH v3 02/30] gpu: nova-core: add FbRange.len() and use it in boot.rs John Hubbard
2026-02-06 4:20 ` [PATCH v3 03/30] gpu: nova-core: Hopper/Blackwell: basic GPU identification John Hubbard
2026-02-06 4:20 ` [PATCH v3 04/30] gpu: nova-core: factor .fwsignature* selection into a new get_gsp_sigs_section() John Hubbard
2026-02-06 4:20 ` [PATCH v3 05/30] gpu: nova-core: use GPU Architecture to simplify HAL selections John Hubbard
2026-02-06 18:02 ` Timur Tabi
2026-02-09 1:47 ` John Hubbard
2026-02-06 4:20 ` [PATCH v3 06/30] gpu: nova-core: apply the one "use" item per line policy to commands.rs John Hubbard
2026-02-06 4:21 ` [PATCH v3 07/30] gpu: nova-core: set DMA mask width based on GPU architecture John Hubbard
2026-02-06 4:21 ` [PATCH v3 08/30] gpu: nova-core: Hopper/Blackwell: skip GFW boot waiting John Hubbard
2026-02-06 4:21 ` [PATCH v3 09/30] gpu: nova-core: move firmware image parsing code to firmware.rs John Hubbard
2026-02-06 4:21 ` [PATCH v3 10/30] gpu: nova-core: factor out a section_name_eq() function John Hubbard
2026-02-06 4:21 ` [PATCH v3 11/30] gpu: nova-core: don't assume 64-bit firmware images John Hubbard
2026-02-06 4:21 ` [PATCH v3 12/30] gpu: nova-core: add support for 32-bit " John Hubbard
2026-02-06 4:21 ` [PATCH v3 13/30] gpu: nova-core: add auto-detection of 32-bit, 64-bit " John Hubbard
2026-02-06 4:21 ` [PATCH v3 14/30] gpu: nova-core: Hopper/Blackwell: add FMC firmware image, in support of FSP John Hubbard
2026-02-06 4:21 ` [PATCH v3 15/30] gpu: nova-core: Hopper/Blackwell: add FSP falcon engine stub John Hubbard
2026-02-06 4:21 ` [PATCH v3 16/30] gpu: nova-core: Hopper/Blackwell: add FSP falcon EMEM operations John Hubbard
2026-02-06 18:07 ` Timur Tabi
2026-02-09 1:56 ` John Hubbard
2026-02-06 4:21 ` [PATCH v3 17/30] gpu: nova-core: Hopper/Blackwell: add FSP message infrastructure John Hubbard
2026-02-06 4:21 ` [PATCH v3 18/30] gpu: nova-core: Hopper/Blackwell: calculate reserved FB heap size John Hubbard
2026-02-06 4:21 ` [PATCH v3 19/30] gpu: nova-core: Hopper/Blackwell: add FSP secure boot completion waiting John Hubbard
2026-02-06 4:21 ` [PATCH v3 20/30] gpu: nova-core: Hopper/Blackwell: add FSP message structures John Hubbard
2026-02-06 19:41 ` Timur Tabi
2026-02-09 1:59 ` John Hubbard
2026-02-06 4:21 ` [PATCH v3 21/30] gpu: nova-core: Hopper/Blackwell: add FMC signature extraction John Hubbard
2026-02-06 4:21 ` [PATCH v3 22/30] gpu: nova-core: Hopper/Blackwell: add FSP send/receive messaging John Hubbard
2026-02-06 4:21 ` [PATCH v3 23/30] gpu: nova-core: Hopper/Blackwell: add FSP Chain of Trust boot John Hubbard
2026-02-06 4:21 ` [PATCH v3 24/30] gpu: nova-core: Hopper/Blackwell: larger non-WPR heap John Hubbard
2026-02-06 4:21 ` [PATCH v3 25/30] gpu: nova-core: Hopper/Blackwell: larger WPR2 (GSP) heap John Hubbard
2026-02-06 19:03 ` Timur Tabi
2026-02-09 2:05 ` John Hubbard [this message]
2026-02-06 4:21 ` [PATCH v3 26/30] gpu: nova-core: refactor SEC2 booter loading into run_booter() helper John Hubbard
2026-02-06 4:21 ` [PATCH v3 27/30] gpu: nova-core: Hopper/Blackwell: add GSP lockdown release polling John Hubbard
2026-02-06 4:21 ` [PATCH v3 28/30] gpu: nova-core: Hopper/Blackwell: add FSP Chain of Trust boot path John Hubbard
2026-02-06 4:21 ` [PATCH v3 29/30] gpu: nova-core: Hopper/Blackwell: new location for PCI config mirror John Hubbard
2026-02-06 4:21 ` [PATCH v3 30/30] gpu: nova-core: clarify the GPU firmware boot steps John Hubbard
2026-02-06 18:43 ` Timur Tabi
2026-02-09 2:14 ` John Hubbard
2026-02-09 2:22 ` John Hubbard
2026-02-09 4:24 ` Timur Tabi
2026-02-09 8:05 ` 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=71e90bb8-b7de-48e7-a43a-68d1e73bbe6a@nvidia.com \
--to=jhubbard@nvidia.com \
--cc=a.hindborg@kernel.org \
--cc=acourbot@nvidia.com \
--cc=airlied@gmail.com \
--cc=alex.gaynor@gmail.com \
--cc=aliceryhl@google.com \
--cc=apopple@nvidia.com \
--cc=bhelgaas@google.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun.feng@gmail.com \
--cc=dakr@kernel.org \
--cc=ecourtney@nvidia.com \
--cc=gary@garyguo.net \
--cc=joelagnelf@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=nouveau@lists.freedesktop.org \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=simona@ffwll.ch \
--cc=tmgross@umich.edu \
--cc=ttabi@nvidia.com \
--cc=zhiw@nvidia.com \
/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
all inboxes | Powered by JetHome®