From: Timur Tabi <ttabi@nvidia.com>
To: Danilo Krummrich <dakr@kernel.org>,
Alexandre Courbot <acourbot@nvidia.com>,
John Hubbard <jhubbard@nvidia.com>,
Eliot Courtney <ecourtney@nvidia.com>, <nova-gpu@lists.linux.dev>
Subject: [PATCH v2 4/7] gpu: nova-core: remove heap size related HAL functions
Date: Mon, 16 Nov 2026 13:54:38 -0600 [thread overview]
Message-ID: <20261116195441.940595-5-ttabi@nvidia.com> (raw)
In-Reply-To: <20261116195441.940595-1-ttabi@nvidia.com>
Now that Nova-core reads all heap size values from the TLVs, we can
remove all of the HAL functions that used to provide that data.
Signed-off-by: Timur Tabi <ttabi@nvidia.com>
---
drivers/gpu/nova-core/fb/hal.rs | 8 ------
drivers/gpu/nova-core/fb/hal/ga100.rs | 8 ------
drivers/gpu/nova-core/fb/hal/ga102.rs | 8 ------
drivers/gpu/nova-core/fb/hal/gb100.rs | 41 +--------------------------
drivers/gpu/nova-core/fb/hal/gb202.rs | 13 +--------
drivers/gpu/nova-core/fb/hal/gh100.rs | 12 +-------
drivers/gpu/nova-core/fb/hal/tu102.rs | 16 -----------
7 files changed, 3 insertions(+), 103 deletions(-)
diff --git a/drivers/gpu/nova-core/fb/hal.rs b/drivers/gpu/nova-core/fb/hal.rs
index e30eb7de2a1c..53821e4a70dd 100644
--- a/drivers/gpu/nova-core/fb/hal.rs
+++ b/drivers/gpu/nova-core/fb/hal.rs
@@ -33,14 +33,6 @@ pub(crate) trait FbHal {
/// Returns the VRAM size, in bytes.
fn vidmem_size(&self, bar: Bar0<'_>) -> u64;
- /// Returns the amount of VRAM to reserve for the PMU.
- #[expect(unused)]
- fn pmu_reserved_size(&self) -> u32;
-
- /// Returns the non-WPR heap size for this chipset, in bytes.
- #[expect(unused)]
- fn non_wpr_heap_size(&self) -> u64;
-
/// Returns the FRTS size, in bytes.
fn frts_size(&self) -> u64;
}
diff --git a/drivers/gpu/nova-core/fb/hal/ga100.rs b/drivers/gpu/nova-core/fb/hal/ga100.rs
index a81b3e42ae41..d0950d1f2339 100644
--- a/drivers/gpu/nova-core/fb/hal/ga100.rs
+++ b/drivers/gpu/nova-core/fb/hal/ga100.rs
@@ -70,14 +70,6 @@ fn vidmem_size(&self, bar: Bar0<'_>) -> u64 {
super::tu102::vidmem_size_gp102(bar)
}
- fn pmu_reserved_size(&self) -> u32 {
- super::tu102::pmu_reserved_size_tu102()
- }
-
- fn non_wpr_heap_size(&self) -> u64 {
- super::tu102::non_wpr_heap_size_tu102()
- }
-
// GA100 is a special case where its FRTS region exists, but is empty. We
// return a size of 0 because we still need to record where the region starts.
fn frts_size(&self) -> u64 {
diff --git a/drivers/gpu/nova-core/fb/hal/ga102.rs b/drivers/gpu/nova-core/fb/hal/ga102.rs
index a5eeddb8a1ae..837bac1b7b2c 100644
--- a/drivers/gpu/nova-core/fb/hal/ga102.rs
+++ b/drivers/gpu/nova-core/fb/hal/ga102.rs
@@ -37,14 +37,6 @@ fn vidmem_size(&self, bar: Bar0<'_>) -> u64 {
vidmem_size_ga102(bar)
}
- fn pmu_reserved_size(&self) -> u32 {
- super::tu102::pmu_reserved_size_tu102()
- }
-
- fn non_wpr_heap_size(&self) -> u64 {
- super::tu102::non_wpr_heap_size_tu102()
- }
-
fn frts_size(&self) -> u64 {
super::tu102::frts_size_tu102()
}
diff --git a/drivers/gpu/nova-core/fb/hal/gb100.rs b/drivers/gpu/nova-core/fb/hal/gb100.rs
index 7e6dc40dff32..53d403d9487b 100644
--- a/drivers/gpu/nova-core/fb/hal/gb100.rs
+++ b/drivers/gpu/nova-core/fb/hal/gb100.rs
@@ -11,12 +11,7 @@
Mmio, //
},
num::Bounded,
- prelude::*,
- ptr::{
- const_align_up,
- Alignment, //
- },
- sizes::*, //
+ prelude::*, //
};
use crate::{
@@ -78,31 +73,6 @@ fn write_sysmem_flush_page_gb100(hshub0: Mmio<'_, regs::Hshub0Registers>, addr:
hshub0.write_reg(regs::NV_PFB_HSHUB_EG_PCIE_FLUSH_SYSMEM_ADDR_LO::zeroed().with_adr(addr_lo));
}
-/// PMU backing store, `kpmuReservedMemoryBackingStoreSizeGet` in OpenRM for the chipsets whose
-/// PMU initializes itself: 9 MiB + 320 KiB.
-const PMU_BACKING_STORE_SIZE: usize = 0x95_0000;
-
-/// PMU surfaces, `kpmuReservedMemorySurfacesSizeGet` in OpenRM.
-const PMU_SURFACES_SIZE: usize = SZ_16M + SZ_256K;
-
-/// Miscellaneous PMU memory.
-const PMU_MISC_SIZE: usize = SZ_4K;
-
-/// Alignment of the PMU reserved region, `KPMU_RESERVED_MEMORY_ALIGNMENT` in OpenRM.
-const PMU_RESERVED_MEMORY_ALIGNMENT: Alignment = Alignment::new::<SZ_128K>();
-
-/// PMU region above FRTS: the backing store, the surfaces and the miscellaneous memory, aligned to
-/// [`PMU_RESERVED_MEMORY_ALIGNMENT`].
-const PMU_RESERVED_SIZE: usize = const_align_up(
- PMU_BACKING_STORE_SIZE + PMU_SURFACES_SIZE + PMU_MISC_SIZE,
- PMU_RESERVED_MEMORY_ALIGNMENT,
-)
-.unwrap();
-
-pub(super) const fn pmu_reserved_size_gb100() -> u32 {
- cv!(PMU_RESERVED_SIZE)
-}
-
impl FbHal for Gb100 {
fn read_sysmem_flush_page(&self, bar: Bar0<'_>) -> u64 {
read_sysmem_flush_page_gb100(hshub0(bar))
@@ -124,15 +94,6 @@ fn vidmem_size(&self, bar: Bar0<'_>) -> u64 {
super::ga102::vidmem_size_ga102(bar)
}
- fn pmu_reserved_size(&self) -> u32 {
- pmu_reserved_size_gb100()
- }
-
- fn non_wpr_heap_size(&self) -> u64 {
- // Non-WPR heap for GB10x (see Open RM: kgspGetNonWprHeapSize, GB100/GB102).
- u64::SZ_2M
- }
-
fn frts_size(&self) -> u64 {
super::tu102::frts_size_tu102()
}
diff --git a/drivers/gpu/nova-core/fb/hal/gb202.rs b/drivers/gpu/nova-core/fb/hal/gb202.rs
index 1d36954a2776..90673ef4a05a 100644
--- a/drivers/gpu/nova-core/fb/hal/gb202.rs
+++ b/drivers/gpu/nova-core/fb/hal/gb202.rs
@@ -6,8 +6,7 @@
use kernel::{
io::Io,
num::Bounded,
- prelude::*,
- sizes::SizeConstants, //
+ prelude::*, //
};
use crate::{
@@ -67,16 +66,6 @@ fn vidmem_size(&self, bar: Bar0<'_>) -> u64 {
super::ga102::vidmem_size_ga102(bar)
}
- fn pmu_reserved_size(&self) -> u32 {
- super::gb100::pmu_reserved_size_gb100()
- }
-
- fn non_wpr_heap_size(&self) -> u64 {
- // Non-WPR heap for GB20x (see OpenRM: kgspGetNonWprHeapSize, GB202+). This size is
- // r000-specific.
- 3 * u64::SZ_1M
- }
-
fn frts_size(&self) -> u64 {
super::tu102::frts_size_tu102()
}
diff --git a/drivers/gpu/nova-core/fb/hal/gh100.rs b/drivers/gpu/nova-core/fb/hal/gh100.rs
index cf8e6403ef98..945760953ee4 100644
--- a/drivers/gpu/nova-core/fb/hal/gh100.rs
+++ b/drivers/gpu/nova-core/fb/hal/gh100.rs
@@ -4,8 +4,7 @@
use kernel::{
io::Io,
num::Bounded,
- prelude::*,
- sizes::SizeConstants, //
+ prelude::*, //
};
use crate::{
@@ -59,15 +58,6 @@ fn vidmem_size(&self, bar: Bar0<'_>) -> u64 {
super::ga102::vidmem_size_ga102(bar)
}
- fn pmu_reserved_size(&self) -> u32 {
- super::tu102::pmu_reserved_size_tu102()
- }
-
- fn non_wpr_heap_size(&self) -> u64 {
- // Non-WPR heap for Hopper (see Open RM: kgspCalculateFbLayout_GH100).
- u64::SZ_2M
- }
-
fn frts_size(&self) -> u64 {
super::tu102::frts_size_tu102()
}
diff --git a/drivers/gpu/nova-core/fb/hal/tu102.rs b/drivers/gpu/nova-core/fb/hal/tu102.rs
index bf5967cbffd3..fac30be446c7 100644
--- a/drivers/gpu/nova-core/fb/hal/tu102.rs
+++ b/drivers/gpu/nova-core/fb/hal/tu102.rs
@@ -42,14 +42,6 @@ pub(super) fn vidmem_size_gp102(bar: Bar0<'_>) -> u64 {
.usable_fb_size()
}
-pub(super) const fn pmu_reserved_size_tu102() -> u32 {
- 0
-}
-
-pub(super) const fn non_wpr_heap_size_tu102() -> u64 {
- u64::SZ_1M
-}
-
pub(super) const fn frts_size_tu102() -> u64 {
u64::SZ_1M
}
@@ -73,14 +65,6 @@ fn vidmem_size(&self, bar: Bar0<'_>) -> u64 {
vidmem_size_gp102(bar)
}
- fn pmu_reserved_size(&self) -> u32 {
- pmu_reserved_size_tu102()
- }
-
- fn non_wpr_heap_size(&self) -> u64 {
- non_wpr_heap_size_tu102()
- }
-
fn frts_size(&self) -> u64 {
frts_size_tu102()
}
--
2.54.0
next prev parent reply other threads:[~2026-11-16 19:55 UTC|newest]
Thread overview: 8+ 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-16 19:54 ` [PATCH v2 2/7] gpu: nova-core: read GSP heap variables from TLV 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-16 19:54 ` Timur Tabi [this message]
2026-11-16 19:54 ` [PATCH v2 5/7] gpu: nova-core: add TLV versions of WPR heap size functions 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-16 19:54 ` [PATCH v2 7/7] gpu: nova-core: remove LibosParams Timur Tabi
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=20261116195441.940595-5-ttabi@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