Re: [PATCH v2] drm/virtio: Align host mapping request to maximum platform page size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 1/26/25 00:08, Sasha Finkelstein via B4 Relay wrote:
> --- a/drivers/gpu/drm/virtio/virtgpu_vram.c
> +++ b/drivers/gpu/drm/virtio/virtgpu_vram.c
> @@ -150,8 +150,8 @@ static int virtio_gpu_vram_map(struct virtio_gpu_object *bo)
>  		return -EINVAL;
>  
>  	spin_lock(&vgdev->host_visible_lock);
> -	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);
>  	spin_unlock(&vgdev->host_visible_lock);

The BO size is already aligned, no need to align it second time.

Anyways, we first should wait for a reply from Rob RE potential impact
of this change on Freedreno and other non-x86 drivers and non-nctx contexts.

Otherwise, the proper solution would be to pass info about host's page
size to guest using extended virtio protocol. This is very doable if you
have time to work on this useful feature and want to contribute/learn more.

-- 
Best regards,
Dmitry





[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux