On Wed Feb 25, 2026 at 7:53 AM JST, Joel Fernandes wrote:
<snip>
> diff --git a/drivers/gpu/nova-core/mm/pramin.rs
> b/drivers/gpu/nova-core/mm/pramin.rs
> index 04b652d3ee4f..30b1dba0c305 100644
> --- a/drivers/gpu/nova-core/mm/pramin.rs
> +++ b/drivers/gpu/nova-core/mm/pramin.rs
> @@ -290,3 +290,164 @@ fn drop(&mut self) {
> // MutexGuard drops automatically, releasing the lock.
> }
> }
> +
> +/// Run PRAMIN self-tests during boot if self-tests are enabled.
> +#[cfg(CONFIG_NOVA_MM_SELFTESTS)]
> +pub(crate) fn run_self_test(
> + dev: &kernel::device::Device,
> + bar: Arc<Devres<Bar0>>,
> + mmu_version: super::pagetable::MmuVersion,
> +) -> Result {
> + use super::pagetable::MmuVersion;
> +
> + // PRAMIN support is only for MMU v2 for now (Turing/Ampere/Ada).
> + if mmu_version != MmuVersion::V2 {
Why is that? I thought PRAMIN was also working on Hopper+. Isn't it
orthogonal to the kind of MMU used?
> + dev_info!(
> + dev,
> + "PRAMIN: Skipping self-tests for MMU {:?} (only V2 supported)\n",
> + mmu_version
> + );
> + return Ok(());
> + }
> +
> + dev_info!(dev, "PRAMIN: Starting self-test...\n");
> +
> + let pramin = Arc::pin_init(Pramin::new(bar)?, GFP_KERNEL)?;
> + let mut win = pramin.window()?;
> +
> + // Use offset 0x1000 as test area.
> + let base: usize = 0x1000;
> +
> + // Test 1: Read/write at byte-aligned locations.
Let's split each test into its own function for readability.