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] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 16 Jul 2019 17:13:10 -0700
From:   Rob Clark <robdclark@...il.com>
To:     Eric Anholt <eric@...olt.net>
Cc:     dri-devel <dri-devel@...ts.freedesktop.org>,
        Chris Wilson <chris@...is-wilson.co.uk>,
        Intel Graphics Development <intel-gfx@...ts.freedesktop.org>,
        Rob Clark <robdclark@...omium.org>,
        David Airlie <airlied@...ux.ie>,
        Daniel Vetter <daniel@...ll.ch>,
        Emil Velikov <emil.velikov@...labora.com>,
        Eric Biggers <ebiggers@...gle.com>,
        Deepak Sharma <deepak.sharma@....com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3 3/3] drm/vgem: use normal cached mmap'ings

On Tue, Jul 16, 2019 at 4:39 PM Eric Anholt <eric@...olt.net> wrote:
>
> Rob Clark <robdclark@...il.com> writes:
>
> > From: Rob Clark <robdclark@...omium.org>
> >
> > Since there is no real device associated with VGEM, it is impossible to
> > end up with appropriate dev->dma_ops, meaning that we have no way to
> > invalidate the shmem pages allocated by VGEM.  So, at least on platforms
> > without drm_cflush_pages(), we end up with corruption when cache lines
> > from previous usage of VGEM bo pages get evicted to memory.
> >
> > The only sane option is to use cached mappings.
>
> This may be an improvement, but...
>
> pin/unpin is only on attaching/closing the dma-buf, right?  So, great,
> you flushed the cached map once after exporting the vgem dma-buf to the
> actual GPU device, but from then on you still have no interface for
> getting coherent access through VGEM's mapping again, which still
> exists.

In *theory* one would detach before doing further CPU access to
buffer, and then re-attach when passing back to GPU.

Ofc that isn't how actual drivers do things.  But maybe it is enough
for vgem to serve it's purpose (ie. test code).

> I feel like this is papering over something that's really just broken,
> and we should stop providing VGEM just because someone wants to write
> dma-buf test code without driver-specific BO alloc ioctl code.

yup, it is vgem that is fundamentally broken (or maybe more
specifically doesn't fit in w/ dma-mappings view of how to do cache
maint), and I'm just papering over it because people and CI systems
want to be able to use it to do some dma-buf tests ;-)

I'm kinda wondering, at least for arm/dt based systems, if there is a
way (other than in early boot) that we can inject a vgem device node
into the dtb.  That isn't a thing drivers should normally do, but (if
possible) since vgem is really just test infrastructure, it could be a
way to make dma-mapping happily think vgem is a real device.

BR,
-R

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ