Re: [PATCH v6 30/34] gpu: nova-core: Hopper/Blackwell: larger WPR2 (GSP) heap
From: Alexandre Courbot
Date: Tue Mar 17 2026 - 04:27:00 EST
On Tue Mar 10, 2026 at 11:11 AM JST, John Hubbard wrote:
<snip>
> /// Returns the amount of memory to reserve for management purposes for a framebuffer of size
> /// `fb_size`.
> - fn management_overhead(fb_size: u64) -> u64 {
> + fn management_overhead(fb_size: u64) -> Result<u64> {
> let fb_size_gb = fb_size.div_ceil(u64::from_safe_cast(kernel::sizes::SZ_1G));
>
> 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)
> + .ok_or(EINVAL)
Since we are turning this into a fallible method (which I agree is the
good move), can we also turn the multiplication into a checked one?
This (alongside making `wpr_heap_size` fallible) should be in a separate
patch, as it is relevant regardless of Blackwell support.