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]
Message-ID: <20200713190357.GC25301@ziepe.ca>
Date:   Mon, 13 Jul 2020 16:03:57 -0300
From:   Jason Gunthorpe <jgg@...pe.ca>
To:     Daniel Vetter <daniel.vetter@...ll.ch>
Cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Oded Gabbay <oded.gabbay@...il.com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        SW_Drivers@...ana.ai, Ofir Bitton <obitton@...ana.ai>
Subject: Re: [PATCH 1/3] habanalabs: implement dma-fence mechanism

On Mon, Jul 13, 2020 at 08:34:12PM +0200, Daniel Vetter wrote:
> On Mon, Jul 13, 2020 at 5:57 PM Greg Kroah-Hartman
> <gregkh@...uxfoundation.org> wrote:
> >
> > On Mon, Jul 13, 2020 at 06:54:22PM +0300, Oded Gabbay wrote:
> > > From: Ofir Bitton <obitton@...ana.ai>
> > >
> > > Instead of using standard dma-fence mechanism designed for GPU's, we
> > > introduce our own implementation based on the former one. This
> > > implementation is much more sparse than the original, contains only
> > > mandatory functionality required by the driver.
> >
> > Sad you can't use the in-kernel code for this, I really don't understand
> > what's wrong with using it as-is.
> >
> > Daniel, why do we need/want duplicate code floating around in the tree
> > like this?
> 
> The rules around dma-fence are ridiculously strict, and it only makes
> sense to inflict that upon you if you actually want to participate in
> the cross driver uapi built up around dma-buf and dma-fence.
> 
> I've recently started some lockdep annotations to better enforce these
> rules (and document them), and it's finding tons of subtle bugs even
> in drivers/gpu (and I only just started with annotating drivers:
> 
> https://lore.kernel.org/dri-devel/20200707201229.472834-1-daniel.vetter@ffwll.ch/
> 
> You really don't want to deal with this if you don't have to. If
> drivers/gpu folks (who created this) aren't good enough to understand
> it, maybe it's not a good idea to sprinkle this all over the tree. And
> fundamentally all this is is a slightly fancier struct completion. Use
> that one instead, or a wait_queue.
> 
> I discussed this a bit with Oded, and he thinks it's easier to
> copypaste and simplify, but given that all other drivers seem to get
> by perfectly well with completion or wait_queue, I'm not sure that's a
> solid case.
> 
> Also adding Jason Gunthorpe, who very much suggested this should be
> limited to dma-buf/gpu related usage only.

Without all the cross-driver stuff dma_fence is just a
completion. Using dma_fence to get a completion is big abuse of what
it is intended for.

I think the only problem with this patch is that it keeps too much of
the dma_fence stuff around. From what I could tell it really just
wants to add a kref and completion to struct hl_cs_compl and delete
everything to do with dma_fence.

Not even sure the kref is needed ;)

Jason

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ