lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <60b0bd4e-fcc3-470e-8294-4000731d6b6a@collabora.com>
Date: Sat, 25 Jan 2025 02:34:28 +0300
From: Dmitry Osipenko <dmitry.osipenko@...labora.com>
To: Sasha Finkelstein <fnkl.kernel@...il.com>
Cc: David Airlie <airlied@...hat.com>, Gerd Hoffmann <kraxel@...hat.com>,
 Gurchetan Singh <gurchetansingh@...omium.org>, Chia-I Wu
 <olvaffe@...il.com>, Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
 Maxime Ripard <mripard@...nel.org>, Thomas Zimmermann <tzimmermann@...e.de>,
 Simona Vetter <simona@...ll.ch>, Sergio Lopez <slp@...hat.com>,
 Rob Clark <robdclark@...il.com>, dri-devel@...ts.freedesktop.org,
 virtualization@...ts.linux.dev, linux-kernel@...r.kernel.org,
 asahi@...ts.linux.dev
Subject: Re: [PATCH RESEND] drm/virtio: Align host mapping request to maximum
 platform page size

On 1/25/25 01:58, Sasha Finkelstein wrote:
> On Fri, 24 Jan 2025 at 23:52, Dmitry Osipenko
> <dmitry.osipenko@...labora.com> 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.

Driver should work properly with any VMM. Aligning BO size will work
universally, but then you could do it too in a userspace.

-- 
Best regards,
Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ