mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Alexandre Courbot" <acourbot@nvidia.com>
To: "Zhi Wang" <zhiw@nvidia.com>
Cc: <dakr@kernel.org>, <alex@shazbot.org>, <jgg@nvidia.com>,
	<yishaih@nvidia.com>, <skolothumtho@nvidia.com>,
	<kevin.tian@intel.com>, <airlied@gmail.com>, <simona@ffwll.ch>,
	<ojeda@kernel.org>, <alex.gaynor@gmail.com>,
	<boqun.feng@gmail.com>, <gary@garyguo.net>,
	<bjorn3_gh@protonmail.com>, <lossin@kernel.org>,
	<a.hindborg@kernel.org>, <aliceryhl@google.com>,
	<tmgross@umich.edu>, <jhubbard@nvidia.com>,
	<ecourtney@nvidia.com>, <cjia@nvidia.com>, <smitra@nvidia.com>,
	<kjaju@nvidia.com>, <alkumar@nvidia.com>, <ankita@nvidia.com>,
	<aniketa@nvidia.com>, <kwankhede@nvidia.com>,
	<targupta@nvidia.com>, <nova-gpu@lists.linux.dev>,
	<linux-kernel@vger.kernel.org>, <zhiwang@kernel.org>
Subject: Re: [PATCH 01/13] gpu: nova-core: vgpu: add post-GSP-boot vGPU initialization
Date: Fri, 11 Sep 2026 15:51:00 +0900	[thread overview]
Message-ID: <DLCADFTC0H2Q.36WG0J0WN9NKP@nvidia.com> (raw)
In-Reply-To: <20260905081116.106613-2-zhiw@nvidia.com>

Hi Zhi,

On Sat Sep 5, 2026 at 5:11 PM JST, Zhi Wang wrote:
> GSP-RM does not expose the parameters needed to divide resources among
> vGPU instances until GSP_INIT completes. Before this point VgpuManager
> only knows whether vGPU mode is enabled, so it cannot provide the engine
> topology, VMMU alignment, or channel capacity required by instance
> management.
>
> Decode the VMMU segment size and ordered FIFO engine table from the typed
> GSP_INIT NVKV response. Retain only host-driven engines while preserving
> hardware FIFO order. After a successful GSP_INIT, initialize the manager
> with these values and the 2048-channel capacity, but retain them only when
> vGPU mode is enabled.
>
> Move VgpuManager into Gpu and let it borrow the pinned ChannelIdPool.
> Create that pool with the same channel capacity, order the Gpu fields so
> the manager is dropped before the memory manager, GSP resources, and its
> channel pool, and pass it separately to GSP boot so unload resources do
> not retain a manager reference. Keep a copy of the detected mode in the
> GPU-owned GSP runtime data instead of passing it through the HAL calls.

The commit log reads like this patch tries to group several things
together. The diff below makes it even more clear:

<...>
>  drivers/gpu/nova-core/vgpu.rs            |  91 ---------------
>  drivers/gpu/nova-core/vgpu/mod.rs        | 139 +++++++++++++++++++++++

This moves code around while adding features to the moved block, making
it very difficult to understand what happens looking at the diff.
Typically when you need to do what you will want to split into two
or more patches: one that is purely mechanical and moves the original code to
its destination, ideally without any change, and then the changes you
want to apply, one per patch.

In this case though there is probably no need for the move at all: even
if you plan on adding sub-modules to `vgpu`, the main module can stay in
`vgpu.rs`. Sub-modules can then be named `vgpu/foo.rs`, `vgpu/bar.rs`,
and it will work just fine. Actually I think that's the preferred way of
organizing modules in R4L.

Generally speaking, let's keep mechanical changes, refactorings,
plumbing and only then new features each as separate patches. Not only
does this make it easier to review, it also will give you a better
perspective of your own code and make possible optimizations/reorderings
visible that are not obvious is everything is clumped together.

  reply	other threads:[~2026-09-11  6:51 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-05  8:11 [PATCH 00/13] Introduce NVIDIA vGPU manager and VFIO variant driver Zhi Wang
2026-09-05  8:11 ` [PATCH 01/13] gpu: nova-core: vgpu: add post-GSP-boot vGPU initialization Zhi Wang
2026-09-11  6:51   ` Alexandre Courbot [this message]
2026-09-05  8:11 ` [PATCH 02/13] gpu: nova-core: mm: add VramBlock and Bar1Map Zhi Wang
2026-09-11  5:01   ` Alistair Popple
2026-09-05  8:11 ` [PATCH 03/13] gpu: nova-core: vgpu: add VRAM slot allocator Zhi Wang
2026-09-05  8:11 ` [PATCH 04/13] gpu: nova-core: vgpu: add r000 plugin bindings Zhi Wang
2026-09-05  8:11 ` [PATCH 05/13] gpu: nova-core: vgpu: add instance create/destroy Zhi Wang
2026-09-05  8:11 ` [PATCH 06/13] gpu: nova-core: gsp: add GMC transaction helpers Zhi Wang
2026-09-05  8:11 ` [PATCH 07/13] gpu: nova-core: vgpu: add vGPU bootload Zhi Wang
2026-09-05  8:11 ` [PATCH 08/13] gpu: nova-core: vgpu: implement PluginRpc channel and config params Zhi Wang
2026-09-05  8:11 ` [PATCH 09/13] gpu: nova-core: vgpu: scrub guest framebuffer memory with CeUtils Zhi Wang
2026-09-05  8:11 ` [PATCH 10/13] gpu: nova-core: vgpu: export plugin log buffers via debugfs Zhi Wang
2026-09-05  8:11 ` [PATCH 11/13] gpu: nova-core: vgpu: export lifecycle operations to VFIO Zhi Wang
2026-09-05  8:11 ` [PATCH 12/13] vfio/nvidia-vgpu: add the NVIDIA vGPU VFIO variant driver Zhi Wang
2026-09-09  3:00   ` Alex Williamson
2026-09-11 20:39   ` Danilo Krummrich
2026-09-05  8:11 ` [PATCH 13/13] gpu: nova-core: reserve the 48-VM WPR2 heap Zhi Wang

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=DLCADFTC0H2Q.36WG0J0WN9NKP@nvidia.com \
    --to=acourbot@nvidia.com \
    --cc=a.hindborg@kernel.org \
    --cc=airlied@gmail.com \
    --cc=alex.gaynor@gmail.com \
    --cc=alex@shazbot.org \
    --cc=aliceryhl@google.com \
    --cc=alkumar@nvidia.com \
    --cc=aniketa@nvidia.com \
    --cc=ankita@nvidia.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=cjia@nvidia.com \
    --cc=dakr@kernel.org \
    --cc=ecourtney@nvidia.com \
    --cc=gary@garyguo.net \
    --cc=jgg@nvidia.com \
    --cc=jhubbard@nvidia.com \
    --cc=kevin.tian@intel.com \
    --cc=kjaju@nvidia.com \
    --cc=kwankhede@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=nova-gpu@lists.linux.dev \
    --cc=ojeda@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=skolothumtho@nvidia.com \
    --cc=smitra@nvidia.com \
    --cc=targupta@nvidia.com \
    --cc=tmgross@umich.edu \
    --cc=yishaih@nvidia.com \
    --cc=zhiw@nvidia.com \
    --cc=zhiwang@kernel.org \
    /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®