Re: [PATCH v10 4/7] drm/tyr: add GPU virtual memory (VM) support
From: Deborah Brouwer
Date: Fri Jul 31 2026 - 09:30:10 EST
On Thu, Jul 30, 2026 at 04:40:36PM +0200, Alice Ryhl wrote:
> On Tue, Jul 28, 2026 at 8:39 PM Deborah Brouwer
> <deborah.brouwer@xxxxxxxxxxxxx> wrote:
> >
> > From: Boris Brezillon <boris.brezillon@xxxxxxxxxxxxx>
> >
> > 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 <boris.brezillon@xxxxxxxxxxxxx>
> > Co-developed-by: Daniel Almeida <daniel.almeida@xxxxxxxxxxxxx>
> > Signed-off-by: Daniel Almeida <daniel.almeida@xxxxxxxxxxxxx>
> > Co-developed-by: Deborah Brouwer <deborah.brouwer@xxxxxxxxxxxxx>
> > Signed-off-by: Deborah Brouwer <deborah.brouwer@xxxxxxxxxxxxx>
>
> 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.