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: <CAHpthZo=R=Csru2P8NVY8YKaasb2RTyrMYni-=8ri4K=xd8abA@mail.gmail.com>
Date: Tue, 4 Feb 2025 18:59:07 +0900
From: Ryosuke Yasuoka <ryasuoka@...hat.com>
To: Dmitry Osipenko <dmitry.osipenko@...labora.com>
Cc: airlied@...hat.com, kraxel@...hat.com, gurchetansingh@...omium.org, 
	olvaffe@...il.com, maarten.lankhorst@...ux.intel.com, mripard@...nel.org, 
	tzimmermann@...e.de, daniel@...ll.ch, jfalempe@...hat.com, 
	virtualization@...ts.linux.dev, linux-kernel@...r.kernel.org, 
	dri-devel@...ts.freedesktop.org
Subject: Re: [PATCH v6] drm/virtio: Add drm_panic support

Hi,

On Mon, Feb 3, 2025 at 2:18 AM Dmitry Osipenko
<dmitry.osipenko@...labora.com> wrote:
>
> Hi,
>
> On 1/30/25 12:05, Ryosuke Yasuoka wrote:
> ...
> > +static int virtio_drm_get_scanout_buffer(struct drm_plane *plane,
> > +                                      struct drm_scanout_buffer *sb)
> > +{
> > +     struct virtio_gpu_object *bo;
> > +
> > +     if (!plane->state || !plane->state->fb || !plane->state->visible)
> > +             return -ENODEV;
> > +
> > +     bo = gem_to_virtio_gpu_obj(plane->state->fb->obj[0]);
> > +     if (virtio_gpu_is_vram(bo) || bo->base.base.import_attach)
> > +             return -ENODEV;
> > +
> > +     /* try to vmap it if possible */
> > +     if (!bo->base.vaddr) {
> > +             int ret;
> > +
> > +             ret = drm_gem_shmem_vmap(&bo->base, &sb->map[0]);
>
> drm_gem_shmem_vmap() requires BO resv to be locked, it also may invoke
> drm_gem_shmem_get_pages() that sleeps. This function can't be used in
> atomic context.
>
> For the starter, let's reject !bo->base.vaddr BOs. Normally, shmem FB
> BOs are always vmapped.

OK. I'll reject !bo->base.vaddr BO in the next patch. I think this panic
feature won't work when I call panic in GUI environment (I test in Gnome)
without vmap(). It is OK as the first version but I think I should mention
it somewhere. Where should I mention, in a commit message or in code like below?

~~~
static int virtio_drm_get_scanout_buffer(struct drm_plane *plane,
struct drm_scanout_buffer *sb)
{
struct virtio_gpu_object *bo;

if (!plane->state || !plane->state->fb || !plane->state->visible)
return -ENODEV;

bo = gem_to_virtio_gpu_obj(plane->state->fb->obj[0]);

/* Only support mapped shmem bo */
if (virtio_gpu_is_vram(bo) || bo->base.base.import_attach || !bo->base.vaddr)
return -ENODEV;
~~~

> --
> Best regards,
> Dmitry
>

Thank you for your comment.
Ryosuke


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ