From: Alice Ryhl <aliceryhl@google.com>
To: Danilo Krummrich <dakr@kernel.org>,
Daniel Almeida <daniel.almeida@collabora.com>
Cc: "Boris Brezillon" <boris.brezillon@collabora.com>,
"Janne Grunau" <j@jannau.net>,
"Matthew Brost" <matthew.brost@intel.com>,
"Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
"Lyude Paul" <lyude@redhat.com>,
"Asahi Lina" <lina+kernel@asahilina.net>,
"Sumit Semwal" <sumit.semwal@linaro.org>,
"Christian König" <christian.koenig@amd.com>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
rust-for-linux@vger.kernel.org, linux-media@vger.kernel.org,
"Alice Ryhl" <aliceryhl@google.com>
Subject: [PATCH v6 0/5] Rust GPUVM immediate mode
Date: Thu, 09 Apr 2026 15:26:05 +0000 [thread overview]
Message-ID: <20260409-gpuvm-rust-v6-0-b16e6ada7261@google.com> (raw)
This series provides an immediate mode GPUVM implementation.
Only immediate mode is provided for Rust code, as all planned Rust
drivers intend to use GPUVM in immediate mode.
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
---
Changes in v6:
- Rebase on drm-rust-next-2026-04-06. As a result, the dma-resv helpers
patch is dropped because it was already merged into drm-rust-next.
- Fix Send/Sync impls for GpuVm<T> to take T:Send into account.
- Fix Send/Sync impls and data()/data_ref() methods on UniqueRefGpuVm to
take T:Send and T:Shync into account.
- Pass __GFP_ZERO to kbox, so that data is zeroed when calling drm_gpuvm_init.
- Call drm_gpuvm_bo_extobj_add() in obtain() even if it returns an
existing pointer to avoid race condition.
- Check that vm_bo is from the correct GpuVm in sm_map().
- Change sm_map() to take &GpuVmBo instead of ARef<GpuVmBo>.
- Document that sparse VAs are not yet supported.
- Link to v5: https://lore.kernel.org/r/20260320-gpuvm-rust-v5-0-76fd44f17a87@google.com
Changes in v5:
- Rename GpuVmCore to UniqueRefGpuVm.
- Implement Send/Sync for GpuVm.
- Move helpers/dma-resv.c in MAINTAINERS
- Improve GpuVmBo allocation and free docs
- Add "in GEM list" invariant to GpuVmBo
- also mention said invariant on GpuVa
- Replace GpuVmBoRegistered with ARef<GpuVmBo>
- Add TODO about dma-resv lock usage
- Add __rust_helper to helpers/drm_gpuvm.c
- Change _invariant type to silence type complexity clippy lint
- Link to v4: https://lore.kernel.org/r/20260130-gpuvm-rust-v4-0-8364d104ff40@google.com
Changes in v4:
- Add trait bound so that DriverGpuVm::Object must be the same type as
Driver::Object.
- Add rust/helpers/dma-resv.c to MAINTAINERS.
- Add __rust_helper to dma_resv_lock and dma_resv_unlock.
- Rename GpuVm::raw_resv_lock() to GpuVm::raw_resv()
- Reword comment in obtain() for adding to extobj list.
- Fix typo in commit message referring to GpuVm<_> instead of GpuVmBo<_>.
- Changed the PhantomData type used for invariance and add comment. (No
functional change.)
- Rename offset to gem_offset in args to sm_map().
- Link to v3: https://lore.kernel.org/r/20260121-gpuvm-rust-v3-0-dd95c04aec35@google.com
Changes in v3:
- C prerequisites have landed, so only Rust part is present.
- The logic for drm_exec was removed, and is for a follow-up.
- Split up into patches.
- Add lifetime to SmStepContext.
- Docs filled out.
- Mutex abstractions used for GEM gpuva lock.
- Drop 'shared data' concept for now. (Can be added back later if required.)
- Rename 'core' field to 'data'.
- GpuVmCore<T> now derefs to GpuVm<T> instead of T.
- Renamed GpuVmBoObtain to GpuVmBoResident.
- Probably more changes I forgot.
- Link to v2: https://lore.kernel.org/r/20260108-gpuvm-rust-v2-0-dbd014005a0b@google.com
Changes in v2:
- For this version, only the C prerequisites are included. Rust will be
sent as follow-up.
- Add comment to drm_gpuvm_bo_destroy_not_in_lists()
- Add Fixes: tag.
- Pick up Reviewed-by tags.
- Link to v1: https://lore.kernel.org/r/20251128-gpuvm-rust-v1-0-ebf66bf234e0@google.com
---
Alice Ryhl (4):
rust: gpuvm: add GpuVm::obtain()
rust: gpuvm: add GpuVa struct
rust: gpuvm: add GpuVmCore::sm_unmap()
rust: gpuvm: add GpuVmCore::sm_map()
Asahi Lina (1):
rust: drm: add base GPUVM immediate mode abstraction
MAINTAINERS | 2 +
rust/bindings/bindings_helper.h | 1 +
rust/helpers/drm_gpuvm.c | 26 +++
rust/helpers/helpers.c | 1 +
rust/kernel/drm/gpuvm/mod.rs | 328 ++++++++++++++++++++++++++++++
rust/kernel/drm/gpuvm/sm_ops.rs | 429 ++++++++++++++++++++++++++++++++++++++++
rust/kernel/drm/gpuvm/va.rs | 168 ++++++++++++++++
rust/kernel/drm/gpuvm/vm_bo.rs | 249 +++++++++++++++++++++++
rust/kernel/drm/mod.rs | 1 +
9 files changed, 1205 insertions(+)
---
base-commit: a7a080bb4236ebe577b6776d940d1717912ff6dd
change-id: 20251128-gpuvm-rust-b719cac27ad6
Best regards,
--
Alice Ryhl <aliceryhl@google.com>
next reply other threads:[~2026-04-09 15:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-09 15:26 Alice Ryhl [this message]
2026-04-09 15:26 ` [PATCH v6 1/5] rust: drm: add base GPUVM immediate mode abstraction Alice Ryhl
2026-04-09 15:26 ` [PATCH v6 2/5] rust: gpuvm: add GpuVm::obtain() Alice Ryhl
2026-04-09 15:26 ` [PATCH v6 3/5] rust: gpuvm: add GpuVa struct Alice Ryhl
2026-04-09 15:26 ` [PATCH v6 4/5] rust: gpuvm: add GpuVmCore::sm_unmap() Alice Ryhl
2026-04-09 15:26 ` [PATCH v6 5/5] rust: gpuvm: add GpuVmCore::sm_map() Alice Ryhl
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=20260409-gpuvm-rust-v6-0-b16e6ada7261@google.com \
--to=aliceryhl@google.com \
--cc=boris.brezillon@collabora.com \
--cc=christian.koenig@amd.com \
--cc=dakr@kernel.org \
--cc=daniel.almeida@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=j@jannau.net \
--cc=lina+kernel@asahilina.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=lyude@redhat.com \
--cc=matthew.brost@intel.com \
--cc=rust-for-linux@vger.kernel.org \
--cc=sumit.semwal@linaro.org \
--cc=thomas.hellstrom@linux.intel.com \
/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