All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Eliot Courtney" <ecourtney@nvidia.com>
Cc: ojeda@kernel.org, dri-devel@lists.freedesktop.org,
	"Danilo Krummrich" <dakr@kernel.org>,
	"Alexandre Courbot" <acourbot@nvidia.com>
Subject: Re: [PATCH v2 12/12] gpu: nova-core: mm: Add PRAMIN aperture self-tests
Date: Mon, 10 Aug 2026 14:16:30 +0000	[thread overview]
Message-ID: <20260810141631.5BDB51F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260810-pramin-split-v2-12-65a00b3c7309@nvidia.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The `io_read!` macro invocation uses a runtime loop variable `i` with the `[build: i]` syntax, which relies on the optimizer to eliminate the bounds check and may cause a build failure.
--

--- Patch [12]: [PATCH v2 12/12] gpu: nova-core: mm: Add PRAMIN aperture self-tests ---
commit e3c26c738212001e40a3ab7fef15d2c8cf5421b5
Author: Joel Fernandes <joelagnelf@nvidia.com>

gpu: nova-core: mm: Add PRAMIN aperture self-tests

This commit adds self-tests for the PRAMIN aperture mechanism to verify
correct operation, alignment requirements, and corner cases during GPU probe.
The tests are default disabled and gated behind CONFIG_NOVA_CORE_SELFTESTS.

> diff --git a/drivers/gpu/nova-core/mm/pramin.rs b/drivers/gpu/nova-core/mm/pramin.rs
> --- a/drivers/gpu/nova-core/mm/pramin.rs
> +++ b/drivers/gpu/nova-core/mm/pramin.rs

[ ... ]

> +    fn test_u32_as_bytes(
> +        dev: &device::Device<device::Bound>,
> +        pramin: &mut Pramin<'_>,
> +        base: VramAddress,
> +    ) -> Result {
> +        let addr = base + 0x10;
> +        let val: u32 = 0xDEADBEEF;
> +        pramin.window_at::<u32>(addr)?.view().write_val(val);
> +
> +        let window = pramin.window_at::<[u8; 4]>(addr)?;
> +        for (i, &expected) in val.to_le_bytes().iter().enumerate() {
> +            selftest_assert_eq!(dev, io_read!(window.view(), [build: i]), expected);

[Severity: Low]
Will this cause a link-time build failure if the optimizer does not unroll
the loop?

The io_read! macro invocation in test_u32_as_bytes uses the runtime loop
variable i with the [build: i] syntax. This relies on LLVM optimization
heuristics to unroll the loop and resolve the value statically at build
time.

If the compiler fails to unroll this loop, the code will retain a call to
rust_build_error, which results in an undefined symbol linker error unless
CONFIG_RUST_BUILD_ASSERT_ALLOW is explicitly enabled.

Should this be rewritten to manually unroll the four reads, or use a
runtime index rather than [build: i]?

> +        }
> +        Ok(())
> +    }

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260810-pramin-split-v2-0-65a00b3c7309@nvidia.com?part=12

  reply	other threads:[~2026-08-10 14:16 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-10 13:55 [PATCH v2 00/12] gpu: nova-core: add PRAMIN window support Eliot Courtney
2026-08-10 13:55 ` [PATCH v2 01/12] rust: num: use const_assert! in Bounded Eliot Courtney
2026-08-10 14:07   ` sashiko-bot
2026-08-10 14:23   ` Gary Guo
2026-08-10 22:24   ` Danilo Krummrich
2026-08-10 13:55 ` [PATCH v2 02/12] rust: num: reject Bounded::shr overshifts at build time Eliot Courtney
2026-08-10 14:23   ` Gary Guo
2026-08-10 22:25   ` Danilo Krummrich
2026-08-10 13:55 ` [PATCH v2 03/12] rust: num: add Bounded::shr_exact Eliot Courtney
2026-08-10 22:25   ` Danilo Krummrich
2026-08-10 13:55 ` [PATCH v2 04/12] gpu: nova-core: mm: Add VramAddress type Eliot Courtney
2026-08-10 22:24   ` Danilo Krummrich
2026-08-10 13:55 ` [PATCH v2 05/12] gpu: nova-core: mm: Implement Alignable and Debug for VramAddress Eliot Courtney
2026-08-10 13:55 ` [PATCH v2 06/12] gpu: nova-core: mm: Add PRAMIN window registers Eliot Courtney
2026-08-10 13:55 ` [PATCH v2 07/12] gpu: nova-core: mm: Add the memory management HAL Eliot Courtney
2026-08-10 13:55 ` [PATCH v2 08/12] gpu: nova-core: mm: Add support to use PRAMIN windows to write to VRAM Eliot Courtney
2026-08-10 13:55 ` [PATCH v2 09/12] docs: gpu: nova-core: Document the PRAMIN aperture mechanism Eliot Courtney
2026-08-10 13:55 ` [PATCH v2 10/12] gpu: nova-core: mm: Add GpuMm centralized memory manager Eliot Courtney
2026-08-10 14:09   ` sashiko-bot
2026-08-10 13:55 ` [PATCH v2 11/12] gpu: nova-core: Add self-test assertion macros and config option Eliot Courtney
2026-08-10 14:09   ` sashiko-bot
2026-08-10 13:55 ` [PATCH v2 12/12] gpu: nova-core: mm: Add PRAMIN aperture self-tests Eliot Courtney
2026-08-10 14:16   ` sashiko-bot [this message]
2026-08-10 22:26 ` [PATCH v2 00/12] gpu: nova-core: add PRAMIN window support Danilo Krummrich
2026-08-11 12:31   ` Miguel Ojeda
2026-08-11 12:31 ` Miguel Ojeda

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=20260810141631.5BDB51F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=acourbot@nvidia.com \
    --cc=dakr@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=ecourtney@nvidia.com \
    --cc=ojeda@kernel.org \
    --cc=sashiko-reviews@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.