Re: [PATCH v10 4/7] drm/tyr: add GPU virtual memory (VM) support
Deborah Brouwer <[email protected]> Fri, 31 Jul 2026 06:09:55 -0700
| Newsgroups | org.kernel.vger.rust-for-linux,org.freedesktop.lists.dri-devel,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <amyeozYr_SZC5FbY@um790> |
On Thu, Jul 30, 2026 at 04:40:36PM +0200, Alice Ryhl wrote: > On Tue, Jul 28, 2026 at 8:39 PM Deborah Brouwer > <[email protected]> wrote: > > > > From: Boris Brezillon <[email protected]> > > > > Add GPU virtual address space management using the DRM GPUVM framework. > > Each virtual memory (VM) space is backed by ARM64 LPAE Stage 1 page tables > > and can be mapped into hardware address space (AS) slots for GPU execution. > > > > The implementation provides memory isolation and virtual address > > allocation. VMs support mapping GEM buffer objects with configurable > > protection flags (readonly, noexec, uncached) and handle both 4KB and 2MB > > page sizes. A new_dummy_object() helper is provided to create a dummy GEM > > object for use as a GPUVM root. > > > > The vm module integrates with the MMU for address space activation and > > provides map/unmap/remap operations with page table synchronization. > > > > Signed-off-by: Boris Brezillon <[email protected]> > > Co-developed-by: Daniel Almeida <[email protected]> > > Signed-off-by: Daniel Almeida <[email protected]> > > Co-developed-by: Deborah Brouwer <[email protected]> > > Signed-off-by: Deborah Brouwer <[email protected]> > > There's a 32-bit build failure :( > > error[E0308]: mismatched types > --> /home/runner/work/linux/linux/linux/drivers/gpu/drm/tyr/vm.rs:873:17 > | > 871 | pt.map_pages( > | --------- arguments to this method are incorrect > 872 | curr_iova, > 873 | curr_paddr, > | ^^^^^^^^^^ expected `u32`, found `u64` > | > note: method defined here > --> /home/runner/work/linux/linux/linux/rust/kernel/iommu/pgtable.rs:152:19 > | > 152 | pub unsafe fn map_pages( > | ^^^^^^^^^ > help: you can convert a `u64` to a `u32` and panic if the converted > value doesn't fit > | > 873 | curr_paddr.try_into().unwrap(), > | ++++++++++++++++++++ Alice, I see you fixed it in drm-rust-next by casting curr_paddr to PhysAddr, thank you. I must have added this 32 bit regression trying to double check all of the sizes.