mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Alexandre Courbot" <acourbot@nvidia.com>
To: "Agustín Pereira" <agustin.pereira.ro@gmail.com>
Cc: "Danilo Krummrich" <dakr@kernel.org>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>, <nova-gpu@lists.linux.dev>,
	<dri-devel@lists.freedesktop.org>,
	<rust-for-linux@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH] gpu: nova-core: gsp: add RM alloc/control/free RPCs and client/device API
Date: Wed, 02 Dec 2026 14:42:47 +0900	[thread overview]
Message-ID: <DNA09VB693QI.3P9XBN1XA5SJM@nvidia.com> (raw)
In-Reply-To: <20261202015357.153058-1-agustin.pereira.ro@gmail.com>

On Wed Dec 2, 2026 at 10:53 AM JST, Agustín Pereira wrote:
> Nova-core currently supports only fixed boot and teardown GSP RPCs
> (`SetSystemInfo`, `SetRegistry`, `GetGspStaticInfo`, and
> `UnloadingGuestDriver`). Higher-level GPU subsystems such as FIFO, GR,
> and CE engines require allocating, controlling, and freeing GSP-RM
> objects arranged in a client -> device -> subdevice hierarchy.
>
> Implement the GSP-RM object RPC layer and RAII handle abstractions:

The RPC API is deprecated as we are switching to GMC.

>
> - Add the r570.144 firmware definitions (`rpc_gsp_rm_alloc_v03_00`,
>   `rpc_gsp_rm_control_v03_00`, `rpc_free_v03_00`,
>   `NV0000_ALLOC_PARAMETERS`, `NV0080_ALLOC_PARAMETERS`, and
>   `NV2080_ALLOC_PARAMETERS`) and wrap them in firmware-independent
>   types in `gsp::fw::commands` with compile-time layout assertions and
>   `RmStatus` (`NV_STATUS` to kernel `Error`) conversion.
> - Expose `MsgFunction::GspRmAlloc` and implement typed `CommandToGsp` /
>   `MessageFromGsp` commands (`RmAlloc`, `RmControl`, and `RmFree`) in
>   `gsp::commands`, draining echoed reply payload bytes so the command
>   queue does not warn on unprocessed data.
> - Add `gsp::rm` providing `RmHandle`, an `IdPool`-backed
>   `RmClientIdAllocator` for handle allocation and recycling, and RAII
>   handles (`RmClient`, `RmDevice`, `RmSubdevice`, and `RmObject`) whose
>   Rust lifetime hierarchy enforces child-before-parent `FREE` teardown.
> - Wire `Gsp::alloc_client()` into a `CONFIG_NOVA_CORE_SELFTESTS` probe
>   self-test and add KUnit unit tests (`nova_core_gsp_rm`) covering
>   handle encoding, allocator growth/recycling, `RmStatus` mapping, and
>   RPC wire serialization/reply decoding.
>
> Testing:
> - Compiled `drivers/gpu/nova-core.o` and `drivers/gpu/nova-drm.o` with
>   `LLVM=1 W=1 CLIPPY=1` (`CONFIG_RUST=y`, `CONFIG_NOVA_CORE=m`,
>   `CONFIG_DRM_NOVA=m`) under both (`CONFIG_NOVA_CORE_SELFTESTS=y`,
>   `CONFIG_KUNIT=y`) and (`CONFIG_NOVA_CORE_SELFTESTS=n`,
>   `CONFIG_KUNIT=n`) with zero warnings.
> - Verified formatting with `rustfmt --check` and patch style with
>   `scripts/checkpatch.pl`.
> - Not tested on NVIDIA GPU hardware (live GSP `GSP_RM_ALLOC` / `FREE`
>   self-test execution remains to be verified on hardware); KUnit tests
>   were compile-tested only.
>
> This change was drafted with the assistance of an AI coding assistant
> and must be reviewed and signed off by the human submitter.

Are you even reading what you send, let alone understand it? I'd be
thankful if you could stop sending patches.

      reply	other threads:[~2026-12-02  5:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02  1:53 Agustín Pereira
2026-12-02  5:42 ` Alexandre Courbot [this message]

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=DNA09VB693QI.3P9XBN1XA5SJM@nvidia.com \
    --to=acourbot@nvidia.com \
    --cc=agustin.pereira.ro@gmail.com \
    --cc=airlied@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=dakr@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nova-gpu@lists.linux.dev \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=simona@ffwll.ch \
    /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

all inboxes | Powered by JetHome®