Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp5525413pxv; Wed, 7 Jul 2021 05:58:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxB68ARoXqacfoC7RoWOmZoo3VpNkV8bIafsrnV6CPyYjdgTMVTbelHwOGHWzZYbRcZxUiO X-Received: by 2002:aa7:db94:: with SMTP id u20mr29727282edt.381.1625662695109; Wed, 07 Jul 2021 05:58:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625662695; cv=none; d=google.com; s=arc-20160816; b=IF8FT2VIAdP/h0t2JGjEvzotiwtIYdajz9biVroJdqIRnv6bjNitWcTPN5Hr6Tguu9 VKB/RquEeniaIgNKY6+EbEW+uXwXgsDIqU6eOUV4LnIn/b5ptk+Pn5IFplr72DNWaV/i MypxPYdXHz73uzkPF5ZXPsIdyMdpb+Zw4dqvmdxbcLqxnLOxjS8eOs5U3eVo9CjZtXjR CGtT76Z72s74XhuTneeG3vGhMDbAncjGpTmCkt9A8Ncg9Ahx9jmxNtS1bUDwNZHGhtkx kpfGrHmRz0/CT3C21bcLcEmSVoVIu251Fx4IQych0SffRKC4hZ4v5mJ5k5EBjwBT+xOL dEnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=ZwucK/hcyFDLDJ5ulbYeHz4jdgbFEMTjqApCtmNqV+E=; b=lDJyjf2+cHryhechPvAHdnRfu2slEo62hcGR9YVtesoA1QQLa32IJCeuCQg1TNkuLa gezvUHydv4DxcRB8APkQBUn4SQ7oBZ/FONpWP7L6yBy+grGEKHideEPPXCzgxzVP/um/ xg/2d0h9RO6scoEfBv0lLUo4TxLMOINetPBya736WdfdM/Xa/XQk0flr4zksZLzpn3Q3 fjyuGz9sg4+2Fwum0PSr6yvS/lD9D46rZXREdrJvaQWl3w4KRB6WjGwaujPplrgn1XRw QQ5GKunQ26MGwSYyWK1AfktzV8oyTS5fUVvUUeoTUATY6hBbodv1yGxO4hMEAYlpKgbu kLKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=H6eMViN7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h7si9732056edz.198.2021.07.07.05.57.48; Wed, 07 Jul 2021 05:58:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=H6eMViN7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231572AbhGGM52 (ORCPT + 99 others); Wed, 7 Jul 2021 08:57:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231383AbhGGM50 (ORCPT ); Wed, 7 Jul 2021 08:57:26 -0400 Received: from mail-oi1-x230.google.com (mail-oi1-x230.google.com [IPv6:2607:f8b0:4864:20::230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ADEB9C061574 for ; Wed, 7 Jul 2021 05:54:46 -0700 (PDT) Received: by mail-oi1-x230.google.com with SMTP id w74so3216926oiw.8 for ; Wed, 07 Jul 2021 05:54:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=ZwucK/hcyFDLDJ5ulbYeHz4jdgbFEMTjqApCtmNqV+E=; b=H6eMViN7cPvcwTKvKheJG9sJFRXo5t5JSta3Q1bmZUkcKlz8vytBXOCNkU/JqVul+d VWFc0jOPzvxDOs8qb/ame/veAS9kfUmpd5auGGz/pmDHZ8QpQHUzgiUxkOX4oM1JFoyd r7W1zE/iC95PtQdaLEgxF2Mm+Yb/KXz4c6Ing= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=ZwucK/hcyFDLDJ5ulbYeHz4jdgbFEMTjqApCtmNqV+E=; b=ELJnXS9wKkmxa4TD1eFbhy4G83t0FPf19dTb/IjP9cPW+5dZNqTfUdC8utue7P9p+a Luj5V6JDnuyBBytm4GaB1V06pTDc3bxeCWHEYtHRz9k0hr2pxLFBP8Uqvkjxa9ZILujd xZycaoUD1DuHEF6mb2uR6TVxfScOUPtAFf9jjyQdGQz8gWNc7RoEoxCdMQMpdT58grCQ 9nlLbFoL+g8ojUOHjaWc/PDt5iuhy0UikMvXCIzktHXRmqiHDPySgmhu0D7XpFU5TaAt 6q5srEIRIhOZHkcYVKc4Jzr9RrK26djjssvzGS+J0r1i2+kUSaQ9UCUwD6CJ+g7+G4rH pC9A== X-Gm-Message-State: AOAM531SJ5AxGFy7Icy3i1418q3+ct8J9VTRe4tIdvbpEYbCZVxPgF1w xLL9cgZiJlZ6TaVioFGgZvcrBSvMU9Fo9oJCc+SM5Q== X-Received: by 2002:aca:eb43:: with SMTP id j64mr4775645oih.101.1625662486066; Wed, 07 Jul 2021 05:54:46 -0700 (PDT) MIME-Version: 1.0 References: <20210705130314.11519-1-ogabbay@kernel.org> <20210706122110.GA18273@lst.de> <9af554b1-e4d8-4dd4-5a6a-830f3112941d@gmail.com> In-Reply-To: <9af554b1-e4d8-4dd4-5a6a-830f3112941d@gmail.com> From: Daniel Vetter Date: Wed, 7 Jul 2021 14:54:34 +0200 Message-ID: Subject: Re: [Linaro-mm-sig] [PATCH v4 0/2] Add p2p via dmabuf to habanalabs To: =?UTF-8?Q?Christian_K=C3=B6nig?= Cc: Christoph Hellwig , Oded Gabbay , Linux Kernel Mailing List , Greg KH , Sumit Semwal , =?UTF-8?Q?Christian_K=C3=B6nig?= , Gal Pressman , sleybo@amazon.com, dri-devel , Jason Gunthorpe , linux-rdma , "open list:DMA BUFFER SHARING FRAMEWORK" , Doug Ledford , "airlied@gmail.com" , Alex Deucher , Leon Romanovsky , amd-gfx list , "moderated list:DMA BUFFER SHARING FRAMEWORK" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 7, 2021 at 2:17 PM Christian K=C3=B6nig wrote: > Am 06.07.21 um 14:23 schrieb Daniel Vetter: > > On Tue, Jul 06, 2021 at 02:21:10PM +0200, Christoph Hellwig wrote: > >> On Tue, Jul 06, 2021 at 10:40:37AM +0200, Daniel Vetter wrote: > >>>> Greg, I hope this will be good enough for you to merge this code. > >>> So we're officially going to use dri-devel for technical details revi= ew > >>> and then Greg for merging so we don't have to deal with other merge > >>> criteria dri-devel folks have? > >>> > >>> I don't expect anything less by now, but it does make the original cl= aim > >>> that drivers/misc will not step all over accelerators folks a complet= e > >>> farce under the totally-not-a-gpu banner. > >>> > >>> This essentially means that for any other accelerator stack that does= n't > >>> fit the dri-devel merge criteria, even if it's acting like a gpu and = uses > >>> other gpu driver stuff, you can just send it to Greg and it's good to= go. > >>> > >>> There's quite a lot of these floating around actually (and many do ha= ve > >>> semi-open runtimes, like habanalabs have now too, just not open enoug= h to > >>> be actually useful). It's going to be absolutely lovely having to exp= lain > >>> to these companies in background chats why habanalabs gets away with = their > >>> stack and they don't. > >> FYI, I fully agree with Daniel here. Habanlabs needs to open up their > >> runtime if they want to push any additional feature in the kernel. > >> The current situation is not sustainable. > > Before anyone replies: The runtime is open, the compiler is still close= d. > > This has become the new default for accel driver submissions, I think > > mostly because all the interesting bits for non-3d accelerators are in = the > > accel ISA, and no longer in the runtime. So vendors are fairly happy to > > throw in the runtime as a freebie. > > Well a compiler and runtime makes things easier, but the real question > is if they are really required for upstreaming a kernel driver? > > I mean what we need is to be able to exercise the functionality. So > wouldn't (for example) an assembler be sufficient? So no one has tried this yet, but I think an assembler, or maybe even just the full PRM for the ISA is also good enough I think. I guess in practice everyone just comes with the compiler for a few reasons= : - AMD and Intel are great and release full PRMs for the gpu, but preparing those takes a lot of time. Often that's done as part of bring up, to make sure everything is annotated properly, so that all the necessary bits are included, but none of the future stuff, or silicon bring-up pieces. So in reality you have the compiler before you have the isa docs. - reverse-engineered drivers also tend to have demo compilers before anything like full ISA docs show up :-) But also the docs tooling they have are great. - then there's the case of developing a driver with NDA'd docs. Again you'll have a compiler as the only real output, there's not going to be any docs or anything like that. > > It's still incomplete, and it's still useless if you want to actually h= ack > > on the driver stack. > > Yeah, when you want to hack on it in the sense of extending it then this > requirement is certainly true. > > But as far as I can see userspace don't need to be extendable to justify > a kernel driver. It just needs to have enough glue to thoughtfully > exercise the relevant kernel interfaces. > > Applying that to GPUs I think what you need to be able to is to write > shaders, but that doesn't need to be in a higher language requiring a > compiler and runtime. Released opcodes and a low level assembler should > be sufficient. Yeah I think in theory ISA docs + assembler testcase or whatever is perfectly fine. In reality anyone who cares enough to do this properly gets to the demo quality compiler stage first, and so that's what we take for merging a new stack. I do disagree that we're only ever asking for this and not more, e.g. if you come with a new 3d accelator and it's not coming with a userspace driver as a mesa MR, you have to do some very serious explaining about wtf you're doing - mesa3d won, pretty much across the board, as a common project for both vulkan and opengl, and the justifications for reinventing wheels better be really good here. Also by the time you've written enough scaffolding to show it integrates in non-stupid ways into mesa, you practically have a demo-quality driver stack anyway. Similar on the display side of things, over the past year consensus for merge criteria have gone up quite a bit, e.g. there's a patch floating around to make that clearer: https://lore.kernel.org/dri-devel/20210706161244.1038592-1-maxime@cerno.tec= h/ Of course this doesn't include anything grandfathered in (*cough* amdvlk *cough*), and also outside of 3d there's clearly no cross-vendor project that's established enough, media, compute, AI/NN stuff is all very badly fragmented. That's maybe lamentable, but like you said not really a reason to reject a kernel driver. -Daniel --=20 Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch