From: Timur Tabi <ttabi@nvidia.com>
To: "nova-gpu@lists.linux.dev" <nova-gpu@lists.linux.dev>,
Alexandre Courbot <acourbot@nvidia.com>,
"dakr@kernel.org" <dakr@kernel.org>,
Eliot Courtney <ecourtney@nvidia.com>,
John Hubbard <jhubbard@nvidia.com>
Subject: Re: [PATCH v2 3/7] gpu: nova-core: use the TLV heap sizes for pmu and non-wpr
Date: Fri, 20 Nov 2026 22:33:39 +0000 [thread overview]
Message-ID: <1f88322ae5c6d879b293b2f2a96a36413dbafef3.camel@nvidia.com> (raw)
In-Reply-To: <DMZU4K5Y7ARN.24GTSON4AGVVV@nvidia.com>
On Fri, 2026-11-20 at 15:47 +0900, Eliot Courtney wrote:
> > let non_wpr_heap = {
> > - let non_wpr_heap_size = hal.non_wpr_heap_size();
> > + let non_wpr_heap_size = gsp_fw.heap_params.tlv_non_wpr_heap_size;
> > FbRange(wpr2.start - non_wpr_heap_size..wpr2.start)
>
> Now that this is using a firmware defined value, it's possible this
> could underflow, so what about using checked_sub instead?
Sure.
> >
> > impl FbSizes {
> > /// Computes the framebuffer region sizes for GSP-FMC boot.
> > - pub(crate) fn new(chipset: Chipset, bar: Bar0<'_>, vgpu_state: VgpuState) -> Result<Self> {
> > + pub(crate) fn new(
> > + chipset: Chipset,
> > + bar: Bar0<'_>,
> > + gsp_fw: &GspFirmware<'_>,
> > +
> > + vgpu_state: VgpuState,
>
> nit: blank line between gsp_fw and vgpu_state
Ok. It's fixed in a later patch, which is why I didn't see it.
> > /// Returns the amount of VRAM to reserve for the PMU.
> > + #[expect(unused)]
> > fn pmu_reserved_size(&self) -> u32;
>
> Unfortunately MSRV rust 1.85 doesn't have as good a handling of
> expect(unused) as the latest one, so this patch produces some unused
> warnings. If you want to keep this patch separate to patch 4, I think
> it needs #[expect(dead_code)] on pmu_reserved_size_tu102(),
> non_wpr_heap_size_tu102() and pmu_reserved_size_gb100(). Thanks!
Well, that doesn't work in 1.94:
warning: this lint expectation is unfulfilled
--> drivers/gpu/nova-core/fb/hal/tu102.rs:45:10
|
45 | #[expect(dead_code)]
| ^^^^^^^^^
I changed it to #[allow(dead_code)] and that seems to work, though. I'll post a v3 with that.
Honestly, I've never been a fan of adding and then removing unused-code attributes within a
patch set. If you're telling me that they now depend on the the Rust compiler version, then
maybe we need to relax these rules a bit.
Just FYI, when building this tree, I already get warnings like this. I've just ignored them.
warning: this lint expectation is unfulfilled
--> drivers/gpu/nova-core/gsp/nvkv/encode.rs:4:45
|
4 | #![cfg_attr(not(CONFIG_KUNIT = "y"), expect(dead_code))]
| ^^^^^^^^^
warning: this lint expectation is unfulfilled
--> drivers/gpu/nova-core/gsp/nvkv/decode.rs:4:45
|
4 | #![cfg_attr(not(CONFIG_KUNIT = "y"), expect(dead_code))]
| ^^^^^^^^^
next prev parent reply other threads:[~2026-11-20 22:33 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 19:54 [PATCH v2 0/7] Transition nova-core to use TLV variables for heap sizes Timur Tabi
2026-11-16 19:54 ` [PATCH v2 1/7] gpu: nova-core: add Tlv.get_u64 Timur Tabi
2026-11-18 4:51 ` Eliot Courtney
2026-11-16 19:54 ` [PATCH v2 2/7] gpu: nova-core: read GSP heap variables from TLV Timur Tabi
2026-11-20 5:23 ` Eliot Courtney
2026-11-20 18:49 ` Timur Tabi
2026-11-16 19:54 ` [PATCH v2 3/7] gpu: nova-core: use the TLV heap sizes for pmu and non-wpr Timur Tabi
2026-11-20 6:47 ` Eliot Courtney
2026-11-20 22:33 ` Timur Tabi [this message]
2026-11-20 22:53 ` John Hubbard
2026-11-16 19:54 ` [PATCH v2 4/7] gpu: nova-core: remove heap size related HAL functions Timur Tabi
2026-11-20 6:47 ` Eliot Courtney
2026-11-16 19:54 ` [PATCH v2 5/7] gpu: nova-core: add TLV versions of WPR heap size functions Timur Tabi
2026-11-20 7:01 ` Eliot Courtney
2026-11-20 22:49 ` Timur Tabi
2026-11-16 19:54 ` [PATCH v2 6/7] gpu: nova-core: change wpr2_heap_params to use TLV values Timur Tabi
2026-11-20 7:27 ` Eliot Courtney
2026-11-16 19:54 ` [PATCH v2 7/7] gpu: nova-core: remove LibosParams Timur Tabi
2026-11-20 6:53 ` Eliot Courtney
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=1f88322ae5c6d879b293b2f2a96a36413dbafef3.camel@nvidia.com \
--to=ttabi@nvidia.com \
--cc=acourbot@nvidia.com \
--cc=dakr@kernel.org \
--cc=ecourtney@nvidia.com \
--cc=jhubbard@nvidia.com \
--cc=nova-gpu@lists.linux.dev \
/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