[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <DFUEIY2MXKH9.1UAD8LZV7FQCX@garyguo.net>
Date: Wed, 21 Jan 2026 16:18:25 +0000
From: "Gary Guo" <gary@...yguo.net>
To: "John Hubbard" <jhubbard@...dia.com>, "Danilo Krummrich"
<dakr@...nel.org>
Cc: "Alexandre Courbot" <acourbot@...dia.com>, "Joel Fernandes"
<joelagnelf@...dia.com>, "Timur Tabi" <ttabi@...dia.com>, "Alistair Popple"
<apopple@...dia.com>, "Edwin Peer" <epeer@...dia.com>, "Zhi Wang"
<zhiw@...dia.com>, "David Airlie" <airlied@...il.com>, "Simona Vetter"
<simona@...ll.ch>, "Bjorn Helgaas" <bhelgaas@...gle.com>, "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>,
<nouveau@...ts.freedesktop.org>, <rust-for-linux@...r.kernel.org>, "LKML"
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 24/31] gpu: nova-core: Hopper/Blackwell: larger non-WPR
heap
On Wed Dec 3, 2025 at 5:59 AM GMT, John Hubbard wrote:
> Hopper, Blackwell and later require more space for the non-WPR heap.
>
> Signed-off-by: John Hubbard <jhubbard@...dia.com>
> ---
> drivers/gpu/nova-core/fb.rs | 15 ++++++++++++---
> drivers/gpu/nova-core/fsp.rs | 2 +-
> 2 files changed, 13 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/nova-core/fb.rs b/drivers/gpu/nova-core/fb.rs
> index e697436de29a..a402a9fe86f8 100644
> --- a/drivers/gpu/nova-core/fb.rs
> +++ b/drivers/gpu/nova-core/fb.rs
> @@ -98,6 +98,16 @@ pub(crate) fn unregister(&self, bar: &Bar0) {
> }
> }
>
> +/// Calculate non-WPR heap size based on chipset architecture.
> +/// This matches the logic used in FSP for consistency.
> +pub(crate) fn calc_non_wpr_heap_size(chipset: Chipset) -> u64 {
> + if chipset.needs_large_reserved_mem() {
> + 0x220000 // ~2.1MB for Hopper/Blackwell+
> + } else {
> + SZ_1M as u64 // 1MB for older architectures
> + }
> +}
I think the patch that introduces the function should be merged with this one.
Best,
Gary
> +
> pub(crate) struct FbRange(Range<u64>);
>
> impl FbRange {
> @@ -238,9 +248,8 @@ pub(crate) fn new(chipset: Chipset, bar: &Bar0, gsp_fw: &GspFirmware) -> Result<
> };
>
> let heap = {
> - const HEAP_SIZE: u64 = usize_as_u64(SZ_1M);
> -
> - FbRange(wpr2.start - HEAP_SIZE..wpr2.start)
> + let heap_size = calc_non_wpr_heap_size(chipset);
> + FbRange(wpr2.start - heap_size..wpr2.start)
> };
>
> // Calculate reserved sizes. PMU reservation is a subset of the total reserved size.
> diff --git a/drivers/gpu/nova-core/fsp.rs b/drivers/gpu/nova-core/fsp.rs
> index 5840ab78e79f..7d46fbcc7abd 100644
> --- a/drivers/gpu/nova-core/fsp.rs
> +++ b/drivers/gpu/nova-core/fsp.rs
> @@ -454,7 +454,7 @@ pub(crate) fn boot_gsp_fmc_with_signatures(
> // frts_offset is relative to FB end: FRTS_location = FB_END - frts_offset
> let frts_offset = if !resume {
> let mut frts_reserved_size = if chipset.needs_large_reserved_mem() {
> - 0x220000 // heap_size_non_wpr for Hopper/Blackwell+
> + crate::fb::calc_non_wpr_heap_size(chipset)
> } else {
> total_reserved_size
> };
Powered by blists - more mailing lists