[PATCH 1/4] rust: drm/gpuvm: add GpuVa::data_ref accessor

From: Alice Ryhl

Date: Tue Nov 17 2026 - 14:33:15 EST


From: Sami Tolvanen <samitolvanen@xxxxxxxxxx>

Tyr's VM_BIND remap path rebuilds page-table mappings for the fragments
that survive a split, and those fragments must keep the protection flags
of the original mapping. Add GpuVa::data_ref() so the remap step can
read the VaData of an existing mapping.

Signed-off-by: Sami Tolvanen <samitolvanen@xxxxxxxxxx>
[aliceryhl: split into separate gpuvm and iommu commits]
Signed-off-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>
---
rust/kernel/drm/gpuvm/va.rs | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/rust/kernel/drm/gpuvm/va.rs b/rust/kernel/drm/gpuvm/va.rs
index 46493f0ec5a6..f81302faba61 100644
--- a/rust/kernel/drm/gpuvm/va.rs
+++ b/rust/kernel/drm/gpuvm/va.rs
@@ -87,6 +87,12 @@ pub fn obj(&self) -> &T::Object {
unsafe { <T::Object as IntoGEMObject>::from_raw((*self.as_raw()).gem.obj) }
}

+ /// Access the driver-private [`VaData`](DriverGpuVm::VaData) associated with this mapping.
+ #[inline]
+ pub fn data_ref(&self) -> &T::VaData {
+ &self.data
+ }
+
/// Returns the underlying [`GpuVmBo`] object that backs this [`GpuVa`].
#[inline]
pub fn vm_bo(&self) -> &GpuVmBo<T> {

--
2.56.1.703.gf848ed807c-goog