Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4813811pxj; Tue, 22 Jun 2021 08:33:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwZ6xffRsf8nt/wrNOPrstp8vF5khq2bY76u1igO2rdxhIGnuc+ScvQw9PfFS3KoJBK1Fu4 X-Received: by 2002:a02:9a0e:: with SMTP id b14mr4529219jal.15.1624376029818; Tue, 22 Jun 2021 08:33:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624376029; cv=none; d=google.com; s=arc-20160816; b=B75/J43nnoMs8Oc1SDTdXhe6tFJ1cr5cWVi4Q/RKuIhZ0OBeeD9anNed6TxYBJJvRW /3O3hUQMCxF8HL5VOQRjXECMZp5q7l023clR9sUHJANftg3VCe4KjxJXHZKcGvAs+SlB NK8I9lqtTWH8b3gWXpPiVJqYcBqAzZ6XEcP7bq61hJvGeh39SaddhPtTeph0pv7wbu8A i6p07IVuulofRLKN4oGiNFuik7YZRBNzJ+5J0rEvi3rJsmwJIx93qBEr/kM3Kmrk8LNi ey0uE3FacZoAdo4TEt/2+5AZ//IWb809n4VOGUbfk7gPzkFI/vz3esRlkiEEoXpFufcF gASw== 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=3ACobuG9GBL6iTgJMQGUeQ4NnxCVUdn2UEz4s51ScZk=; b=a0D7zLAc5owSlMjT+ssXuUaCZrUV2i6E7pz2+7wC5ud0sJISymaZ2E3Rnhz88Qax9k Gv2HFVJ8GlIJMzW2xctS8qmNSgGnLmLdtbPwNwY+pJhvk/PtsrWbR+p+qdFhW+DNmIUa VGSJp/JdjCNI6S53GaIS+3whq2ZUN91hVtGpgYSqgev5NJzk/axunJgHkrgq56mLZbRB pZuvyqtrBXBJ5LBLwywdgbXwWPObqeQ4zIlK192DZBQMqxEDgCk7pDe2LJMVoZjoaCrb RUEwTCj0W806p5PATUx2ZRG7AMSkoNrk92i1IHUyCnp5QCzxG7Xb0YhZSqHCd6sMaZma l97g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FbRKl08R; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j10si20551633iom.77.2021.06.22.08.33.35; Tue, 22 Jun 2021 08:33:49 -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=@gmail.com header.s=20161025 header.b=FbRKl08R; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232145AbhFVPdz (ORCPT + 99 others); Tue, 22 Jun 2021 11:33:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232139AbhFVPdv (ORCPT ); Tue, 22 Jun 2021 11:33:51 -0400 Received: from mail-oi1-x229.google.com (mail-oi1-x229.google.com [IPv6:2607:f8b0:4864:20::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE443C061574; Tue, 22 Jun 2021 08:31:32 -0700 (PDT) Received: by mail-oi1-x229.google.com with SMTP id d19so24194248oic.7; Tue, 22 Jun 2021 08:31:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=3ACobuG9GBL6iTgJMQGUeQ4NnxCVUdn2UEz4s51ScZk=; b=FbRKl08RV+5aNUCIy+bm9R79y0vvn1Fqntx11lMKc7uBstykFXlpjoeTaLfrm6HFII +HEgrFz1c8I98k1PfPI2oRB/vJPXDmZ7gYDvk98AWo4x8o7v0B2KGaLjrV+spIPFeNoQ +dZfs7yBimI8raW3JRyWsffkiQa2vHSo1DFmxWvweSeHp1PLh8ThPMpJQRWXeK66Evlo pDd+cX8OKOIU4tq3oOJn8fvNkOqv8BF2KExwwBZXTVAi9/BNVYgDv1Etlgr4Jnfm2zDG U15DMNfGUTB+tKLKilihttsdLp7AKs76NKs/jFR6oW+8c3b50Hh6Ou4jaazsw8Vz58YB FpTA== 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=3ACobuG9GBL6iTgJMQGUeQ4NnxCVUdn2UEz4s51ScZk=; b=oayfKpb4MRx3dcQRgpcIfn+g7sqocwgu0nn406s0pMEfrSJDwwp9UnHn/ytfKHIC3S RL0a0XepO4cSypLvS4/Y8civPdDduqJFVSWSnp8easzXMoOleQeCVRpVPEZxl1G1Jr/k 7lU1gyolTmMnXBd6n9A3OGiDrcVvNV58lYTGI9PDUILaXsbZkYsjAq3USJNTiiqmkYiC HZKWNQ38JL8j7gtPzk0JlY+KSAkcBUIIis3GeD29cYUHbUHKgyQwKilTR6W8BPlaU4fR 05ZRu7gXn6h/TzYplVNIiIcG1BSQCnvfVZQ2nYbtNcAO1UPmy0dTV1goo6Hod9POjVCv xl3Q== X-Gm-Message-State: AOAM531zK5nW+DkAJ9q99tbmnBI76ChBUOU91WtrJcohQOdFFuKQd/di N7XndFyVP7NZTdwWE319LEiZYIqYe3IdWteI6aA= X-Received: by 2002:aca:ac02:: with SMTP id v2mr3623956oie.154.1624375891987; Tue, 22 Jun 2021 08:31:31 -0700 (PDT) MIME-Version: 1.0 References: <20210621232912.GK1096940@ziepe.ca> <20210622120142.GL1096940@ziepe.ca> <20210622121546.GN1096940@ziepe.ca> <20210622151142.GA2431880@ziepe.ca> <4a37216d-7c4c-081e-3325-82466f30b6eb@amd.com> <20210622152827.GQ1096940@ziepe.ca> In-Reply-To: <20210622152827.GQ1096940@ziepe.ca> From: Oded Gabbay Date: Tue, 22 Jun 2021 18:31:04 +0300 Message-ID: Subject: Re: [Linaro-mm-sig] [PATCH v3 1/2] habanalabs: define uAPI to export FD for DMA-BUF To: Jason Gunthorpe Cc: =?UTF-8?Q?Christian_K=C3=B6nig?= , =?UTF-8?Q?Christian_K=C3=B6nig?= , Gal Pressman , sleybo@amazon.com, linux-rdma , Oded Gabbay , Christoph Hellwig , Linux Kernel Mailing List , dri-devel , "moderated list:DMA BUFFER SHARING FRAMEWORK" , Doug Ledford , Tomer Tayar , amd-gfx list , Greg KH , Alex Deucher , Leon Romanovsky , "open 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 Tue, Jun 22, 2021 at 6:28 PM Jason Gunthorpe wrote: > > On Tue, Jun 22, 2021 at 05:24:08PM +0200, Christian K=C3=B6nig wrote: > > > > > I will take two GAUDI devices and use one as an exporter and one as= an > > > > importer. I want to see that the solution works end-to-end, with re= al > > > > device DMA from importer to exporter. > > > I can tell you it doesn't. Stuffing physical addresses directly into > > > the sg list doesn't involve any of the IOMMU code so any configuratio= n > > > that requires IOMMU page table setup will not work. > > > > Sure it does. See amdgpu_vram_mgr_alloc_sgt: > > > > amdgpu_res_first(res, offset, length, &cursor); > ^^^^^^^^^^ > > I'm not talking about the AMD driver, I'm talking about this patch. > > + bar_address =3D hdev->dram_pci_bar_start + > + (pages[cur_page] - prop->dram_base_addres= s); > + sg_dma_address(sg) =3D bar_address; > > Jason Yes, you are correct of course, but what will happen Jason, If I will add a call to dma_map_resource() like Christian said ? Won't that solve that specific issue ? That's why I want to try it... Oded