Re: [PATCH RESEND] drm/virtio: Align host mapping request to maximum platform page size
From: Sasha Finkelstein
Date: Fri Jan 24 2025 - 17:58:58 EST
On Fri, 24 Jan 2025 at 23:52, Dmitry Osipenko
<dmitry.osipenko@xxxxxxxxxxxxx> wrote:
> > - ret = drm_mm_insert_node(&vgdev->host_visible_mm, &vram->vram_node,
> > - bo->base.base.size);
> > + ret = drm_mm_insert_node_generic(&vgdev->host_visible_mm, &vram->vram_node,
> > + bo->base.base.size, MAX_PAGE_SIZE, 0, 0);
>
> This change only reserves extra space in the memory allocator, but
> doesn't change actual size of allocated BO. Instead, you likely need to
> replace all ALIGN(size, PAGE_SIZE) occurrences in the driver code with
> ALIGN(args->size, MAX_PAGE_SIZE)
This approach is good enough for my usecase, where the vmm can
cope with sub-page gpu allocations (by rounding up to full page),
but can't deal with non page aligned ones.