[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAiTLFV6mAgrMj=itcxoBCibvYRyrAk02wYp-gYJ8kxhF0EPmw@mail.gmail.com>
Date: Mon, 5 Aug 2024 04:14:09 -0500
From: Sergio Lopez Pascual <slp@...hat.com>
To: Dmitry Osipenko <dmitry.osipenko@...labora.com>, gurchetansingh@...omium.org,
tzimmermann@...e.de, mripard@...nel.org, olvaffe@...il.com, kraxel@...hat.com,
daniel@...ll.ch, maarten.lankhorst@...ux.intel.com, airlied@...hat.com
Cc: linux-kernel@...r.kernel.org, virtualization@...ts.linux.dev,
dri-devel@...ts.freedesktop.org
Subject: Re: [PATCH 0/2] drm/virtio: introduce the HOST_PAGE_SIZE feature
Dmitry Osipenko <dmitry.osipenko@...labora.com> writes:
> On 7/23/24 14:49, Sergio Lopez wrote:
>> There's an incresing number of machines supporting multiple page sizes
>> and on these machines the host and a guest can be running, each one,
>> with a different page size.
>>
>> For what pertains to virtio-gpu, this is not a problem if the page size
>> of the guest happens to be bigger or equal than the host, but will
>> potentially lead to failures in memory allocations and/or mappings
>> otherwise.
>
> Please describe concrete problem you're trying to solve. Guest memory
> allocation consists of guest pages, I don't see how knowledge of host
> page size helps anything in userspace.
>
> I suspect you want this for host blobs, but then it should be
> virtio_gpu_vram_create() that should use max(host_page_sz,
> guest_page_size), AFAICT. It's kernel who is responsible for memory
> management, userspace can't be trusted for doing that.
Mesa's Vulkan/Venus uses CREATE_BLOB to request the host the creation
and mapping into the guest of device-backed memory and shmem regions.
The CREATE_BLOB ioctl doesn't update drm_virtgpu_resource_create->size,
so the guest kernel (and, as a consequence, the host kernel) can't
override the user's request.
I'd like Mesa's Vulkan/Venus in the guest to be able to obtain the host
page size to align the size of the CREATE_BLOB requests as required.
Thanks,
Sergio.
Powered by blists - more mailing lists