Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4809946pxj; Tue, 22 Jun 2021 08:29:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzhvrGoo5VglppPQEhpxFMcaxFusWDRLBeB4VGlT5Dv5vZwvIUo9TnDoumNV6EbCYXOfF7x X-Received: by 2002:a92:d0d1:: with SMTP id y17mr3029387ila.218.1624375755378; Tue, 22 Jun 2021 08:29:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624375755; cv=none; d=google.com; s=arc-20160816; b=rS0LXTuoX8uAiQ3W0Mobg2NfTOqx0eDtKGG0QhRTsg+aeUrFAkond4xrUpEHrZMFU2 2kcY2fQEA2l7t6vYvniqmb0y6yZXElKBoOGnCA5sHTkzuls9D8TrQBdR6HG/hboG2174 ycFrlHi9mc+8qQ5UdTn5GIb8B8lc5FO1dBjXctnYT5st6H1WUyRIUgoO6gIuLnyGTMIU YOWPwpBF2eOXT1Q07rFpxO8e8b8IubdC6mxwEzyXPaU9theG0Gvv2Qw3pjRJ0Dogt+s6 g6NZsKzItxjzAXm8TNcx0yU/h3JfRGfKibiZMb5dR6tT6KNqvfN5527nbiQhwDYFqu+g DONQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=gSIT2aB7rHsSORmJBVTerFLvPUzJvuTh9nq+ipo1OW4=; b=puqvB8JRhZthTOgYNWWd09R4s3oNhPS7eDu+VkWiFvY394zbaQbGa74ofNpRzcw01K nDeiajmLDJFzUrB9qQic0z6ly6RoDa+2DPoZQfNXW9VTOfqHROnR2AxbBPueX479MvoT MH26in7isJvt0UyTGBDbslE2oocq/WeHhTvTrH/L58y32j2SLTH4lmx76Xle+8P6zsw6 74cz4avsSf4OSLxkb7DwiBL+pR6vUPx2j9Um9ebL6zBcT3jT14GtN+h6l2si/+9ZTIaj rw1glxnctpC1qEH5ZK6jhmxxzLrqz+0U7yXdIUDb20gQCf+qDT5Cu7ItKQsZRoUMcvBw AzxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=jMJSjWzP; 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 n16si20841527iob.72.2021.06.22.08.29.02; Tue, 22 Jun 2021 08:29: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=@ziepe.ca header.s=google header.b=jMJSjWzP; 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 S232273AbhFVPar (ORCPT + 99 others); Tue, 22 Jun 2021 11:30:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231761AbhFVPaq (ORCPT ); Tue, 22 Jun 2021 11:30:46 -0400 Received: from mail-qt1-x831.google.com (mail-qt1-x831.google.com [IPv6:2607:f8b0:4864:20::831]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA70CC06175F for ; Tue, 22 Jun 2021 08:28:29 -0700 (PDT) Received: by mail-qt1-x831.google.com with SMTP id t9so16291531qtw.7 for ; Tue, 22 Jun 2021 08:28:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=gSIT2aB7rHsSORmJBVTerFLvPUzJvuTh9nq+ipo1OW4=; b=jMJSjWzPfPzqnKB8B3d0txI+f1QCXRwofrHYktBL6Dp/RhK8mDhbKSZcIAeOroGN79 9QKZyuK/IHnSXDzJVZS3X6lKP7w6E8KyRCjjniSQVc0jCI0AkxFDLwDCLmcInmPgiCnf jgWG0hhVMC1nVN8HteDjeVRfh514OJrhlEcH2R925fh0DHPJTQOuXuBlI4DUwVhGyPRl DthIYUE4NB1fnKp7n1suCV8ABft4OFetd4l8JY9SJSPUN6ozC3ygwCBUw+HE0mNeNlWt b8N9Y1O7r/s/b3RUVZtkPQ9u0U0mfuUS0aqx+/yNM9XPrMJnox3nrIaQn6+gPefKB6rN j1AQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=gSIT2aB7rHsSORmJBVTerFLvPUzJvuTh9nq+ipo1OW4=; b=hnbWL9gywO9biNGn+8sbLB9gDE6fws+Wsv+zTCs4d4uEHcGOPV5EK2FE/Gne17XiJf 1ExOxv72XOBKErcU4btPoe5zoH6+NEGBUJh/5FYegRjpYQnLw3W4TSaFiyt7uPpyVP/e 4WUnFe1lQXQ1JrmWWTAxv8X+6v1js3FbL1fqdl8I/zGfHRHC+xm3Q8S31oVMAKukFJrP AhNDt5tW+OeedTksAfqMSdhjNCdyAyYgUpPI04MF9r7EDpQjOv0p+E/KOHLuNoSTfnfU b/4apXwUW6O/+TDRI92FJtJbV1Mfrh+qWu0huJjEzxoJ6T8flY631/HrzfbKpUEY7Xhv wf8w== X-Gm-Message-State: AOAM5315qtc+tH5zfJFouc3W9UuWOY+bmXqEFIF7FUk+1uv/RGh0enJL yswzm27VuKm8M5M7YnpX4KVwDw== X-Received: by 2002:ac8:5ad5:: with SMTP id d21mr3797369qtd.166.1624375708968; Tue, 22 Jun 2021 08:28:28 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-47-55-113-94.dhcp-dynamic.fibreop.ns.bellaliant.net. [47.55.113.94]) by smtp.gmail.com with ESMTPSA id f19sm13636743qkg.70.2021.06.22.08.28.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Jun 2021 08:28:28 -0700 (PDT) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1lviKC-00ADKO-08; Tue, 22 Jun 2021 12:28:28 -0300 Date: Tue, 22 Jun 2021 12:28:27 -0300 From: Jason Gunthorpe To: Christian =?utf-8?B?S8O2bmln?= Cc: Oded Gabbay , Christian =?utf-8?B?S8O2bmln?= , 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" Subject: Re: [Linaro-mm-sig] [PATCH v3 1/2] habanalabs: define uAPI to export FD for DMA-BUF Message-ID: <20210622152827.GQ1096940@ziepe.ca> References: <20210621232912.GK1096940@ziepe.ca> <20210622120142.GL1096940@ziepe.ca> <20210622121546.GN1096940@ziepe.ca> <20210622151142.GA2431880@ziepe.ca> <4a37216d-7c4c-081e-3325-82466f30b6eb@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4a37216d-7c4c-081e-3325-82466f30b6eb@amd.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 22, 2021 at 05:24:08PM +0200, Christian König 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 real > > > 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 configuration > > 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 = hdev->dram_pci_bar_start + + (pages[cur_page] - prop->dram_base_address); + sg_dma_address(sg) = bar_address; Jason