From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3FAAFC2B9F4 for ; Tue, 22 Jun 2021 15:25:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 27CE66023F for ; Tue, 22 Jun 2021 15:25:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232177AbhFVP1O (ORCPT ); Tue, 22 Jun 2021 11:27:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232300AbhFVP1L (ORCPT ); Tue, 22 Jun 2021 11:27:11 -0400 Received: from mail-ot1-x335.google.com (mail-ot1-x335.google.com [IPv6:2607:f8b0:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 096F5C061574; Tue, 22 Jun 2021 08:24:56 -0700 (PDT) Received: by mail-ot1-x335.google.com with SMTP id h24-20020a9d64180000b029036edcf8f9a6so21606083otl.3; Tue, 22 Jun 2021 08:24:56 -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; bh=4X+AcHyDDe3HhjQCq2G+eaJ8kvsIjHhuoyLFdEACcnQ=; b=F9cy62wh9RybK9h82fBHPpp8hPDnZx1s+Z0/GOTSU92eNMyNLfj1mmqR2+r3kT8aM1 xYDm3xoWuWMpBQnf+yCUtYaytLMGRdU+gDGi6swnU2/1W4YjA3DmVGgEJEhpqqWEJhiE 01z+W8Xkif0R9mOOrdnFJqQd5G+uUqQGTMfvsT/2xP5BWwkuBCnE6fDDDeJPKFj99hpa IUTx7/RubZA8kR6BUpUTkctQ7E0FSq1LJm9p8lS8IeiHhgNrTRG9ObqVGWK0oLwjI4ER nWl4Jh30VyNTX8WV9ruVKyd0scG13WLdSbrapyE0pKhuHbHyEx+IQYLAiGL9vT11KyaE aOoQ== 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; bh=4X+AcHyDDe3HhjQCq2G+eaJ8kvsIjHhuoyLFdEACcnQ=; b=Eh7SchjWN0/sC0XIQzwQqaR68iJ7uySxMQOMVWXWPWnQvNUU0Bl/nSndklPp89sDP+ EQKA/lCyqbNfyJkPcuk/nk0iUe9rtQRP7h5k5OTAG1jma9KJ/DWaAgGXCCv+CcfmmgJn 4zMRX4gOYDQO1i2oUL2jp/1aPqG1MGxnmfoNXCuuk5lClx4Tyw5N6o2zjDw2Wv8sbeiX nir0xFCiqZ7WD/sfjC8ZHUkkV0pHjDH7mAxFPTBLx0+X5ayDARRZUq+Eo1gm7FO9eISZ qfuXyW1dmOon2POLz/AtV89aCRXLLCjydIX1iQiPmdUGV+0+LqpdNYZlTex2XY5gwd8G Q8qg== X-Gm-Message-State: AOAM531LgEQnidWugvgE6zkPnQUUUfJYBiMHvv+sXZ5JIuGZlocLAEUv 11mZ3F+Bdkb0EYByogZKAiL80L/sqcxpNtOSUXk= X-Google-Smtp-Source: ABdhPJxdbW8W5cXUxxqtgxKi95nj/EmM2JjajNW5+/OukMinRa2g08LQoWclCFHmO/psGwfcUIox+YZCnLKA4tnM/9A= X-Received: by 2002:a9d:4581:: with SMTP id x1mr3651165ote.145.1624375495284; Tue, 22 Jun 2021 08:24:55 -0700 (PDT) MIME-Version: 1.0 References: <20210621175511.GI1096940@ziepe.ca> <20210621232912.GK1096940@ziepe.ca> <20210622120142.GL1096940@ziepe.ca> <20210622121546.GN1096940@ziepe.ca> <20210622151142.GA2431880@ziepe.ca> In-Reply-To: <20210622151142.GA2431880@ziepe.ca> From: Oded Gabbay Date: Tue, 22 Jun 2021 18:24:28 +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?= , Gal Pressman , sleybo@amazon.com, linux-rdma , Oded Gabbay , Christoph Hellwig , Linux Kernel Mailing List , dri-devel , =?UTF-8?Q?Christian_K=C3=B6nig?= , "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" Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org On Tue, Jun 22, 2021 at 6:11 PM Jason Gunthorpe wrote: > > On Tue, Jun 22, 2021 at 04:12:26PM +0300, Oded Gabbay wrote: > > > > 1) Setting sg_page to NULL > > > 2) 'mapping' pages for P2P DMA without going through the iommu > > > 3) Allowing P2P DMA without using the p2p dma API to validate that it > > > can work at all in the first place. > > > > > > All of these result in functional bugs in certain system > > > configurations. > > > > > > Jason > > > > Hi Jason, > > Thanks for the feedback. > > Regarding point 1, why is that a problem if we disable the option to > > mmap the dma-buf from user-space ? > > Userspace has nothing to do with needing struct pages or not > > Point 1 and 2 mostly go together, you supporting the iommu is not nice > if you dont have struct pages. > > You should study Logan's patches I pointed you at as they are solving > exactly this problem. Yes, I do need to study them. I agree with you here. It appears I have a hole in my understanding. I'm missing the connection between iommu support (which I must have of course) and struct pages. > > > In addition, I didn't see any problem with sg_page being NULL in the > > RDMA p2p dma-buf code. Did I miss something here ? > > No, the design of the dmabuf requires the exporter to do the dma maps > and so it is only the exporter that is wrong to omit all the iommu and > p2p logic. > > RDMA is OK today only because nobody has implemented dma buf support > in rxe/si - mainly because the only implementations of exporters don't Can you please educate me, what is rxe/si ? > set the struct page and are thus buggy. ok... so how come that patch-set was merged into 5.12 if it's buggy ? Because the current exporters are buggy ? I probably need a history lesson here. But I understand why you think it's a bad idea to add a new buggy exporter. > > > 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. > > Jason Yes, that's what I expect to see. But I want to see it with my own eyes and then figure out how to solve this. Maybe the result will be going to Logan's path, maybe something else, but I need to start by seeing the failure in a real system. Thanks for the information, it is really helpful. Oded From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D6DBC48BE5 for ; Tue, 22 Jun 2021 15:24:57 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5CBD4600D1 for ; Tue, 22 Jun 2021 15:24:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5CBD4600D1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 96E916E591; Tue, 22 Jun 2021 15:24:56 +0000 (UTC) Received: from mail-ot1-x332.google.com (mail-ot1-x332.google.com [IPv6:2607:f8b0:4864:20::332]) by gabe.freedesktop.org (Postfix) with ESMTPS id 101DD6E581; Tue, 22 Jun 2021 15:24:56 +0000 (UTC) Received: by mail-ot1-x332.google.com with SMTP id 7-20020a9d0d070000b0290439abcef697so21588549oti.2; Tue, 22 Jun 2021 08:24:56 -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; bh=4X+AcHyDDe3HhjQCq2G+eaJ8kvsIjHhuoyLFdEACcnQ=; b=F9cy62wh9RybK9h82fBHPpp8hPDnZx1s+Z0/GOTSU92eNMyNLfj1mmqR2+r3kT8aM1 xYDm3xoWuWMpBQnf+yCUtYaytLMGRdU+gDGi6swnU2/1W4YjA3DmVGgEJEhpqqWEJhiE 01z+W8Xkif0R9mOOrdnFJqQd5G+uUqQGTMfvsT/2xP5BWwkuBCnE6fDDDeJPKFj99hpa IUTx7/RubZA8kR6BUpUTkctQ7E0FSq1LJm9p8lS8IeiHhgNrTRG9ObqVGWK0oLwjI4ER nWl4Jh30VyNTX8WV9ruVKyd0scG13WLdSbrapyE0pKhuHbHyEx+IQYLAiGL9vT11KyaE aOoQ== 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; bh=4X+AcHyDDe3HhjQCq2G+eaJ8kvsIjHhuoyLFdEACcnQ=; b=Hg24sXjZJyQIh2lA2AJ+rJusCKu6v945U6TH39cxrHxL5mMm0zdNgQZXxEoiEVHRNG s1KYOfBHbTTp1CXuErFerLbOb8IG3fZm9sWoIkeKd/cYeHSw19SQELYjaR+7iC5nwMd1 LL3TC2jr6NyW2G9PMcR5HV0/TytJr9KfstQXeXtqqvUqNIpPmJdK8y6OLrxZucNgJG5w ZqVRji68jRZpIvphLfVUpnBpX6xc+6u5xBs8RKB0c8EJxJ9RuHT0+BAMS21RYVulCU+c AdjXptIQRhhLQoqLghSSNUAtH3K3t1wDHTYDGccdPwbNZagz4KjLe7Ga7GL87Z7Gq6YZ r81w== X-Gm-Message-State: AOAM533XnuhupFMy2A6OqRRK5FUkKnkt8wVzoqNy13jXHfPANI+9G+bU axiPfokEcXQ9i4lpt1I69e94l6yL5MAJkj71miI= X-Google-Smtp-Source: ABdhPJxdbW8W5cXUxxqtgxKi95nj/EmM2JjajNW5+/OukMinRa2g08LQoWclCFHmO/psGwfcUIox+YZCnLKA4tnM/9A= X-Received: by 2002:a9d:4581:: with SMTP id x1mr3651165ote.145.1624375495284; Tue, 22 Jun 2021 08:24:55 -0700 (PDT) MIME-Version: 1.0 References: <20210621175511.GI1096940@ziepe.ca> <20210621232912.GK1096940@ziepe.ca> <20210622120142.GL1096940@ziepe.ca> <20210622121546.GN1096940@ziepe.ca> <20210622151142.GA2431880@ziepe.ca> In-Reply-To: <20210622151142.GA2431880@ziepe.ca> From: Oded Gabbay Date: Tue, 22 Jun 2021 18:24:28 +0300 Message-ID: Subject: Re: [Linaro-mm-sig] [PATCH v3 1/2] habanalabs: define uAPI to export FD for DMA-BUF To: Jason Gunthorpe Content-Type: text/plain; charset="UTF-8" X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?Q?Christian_K=C3=B6nig?= , linux-rdma , =?UTF-8?Q?Christian_K=C3=B6nig?= , sleybo@amazon.com, Gal Pressman , dri-devel , Christoph Hellwig , "moderated list:DMA BUFFER SHARING FRAMEWORK" , Doug Ledford , Tomer Tayar , amd-gfx list , Greg KH , Alex Deucher , Leon Romanovsky , Oded Gabbay , Linux Kernel Mailing List , "open list:DMA BUFFER SHARING FRAMEWORK" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Tue, Jun 22, 2021 at 6:11 PM Jason Gunthorpe wrote: > > On Tue, Jun 22, 2021 at 04:12:26PM +0300, Oded Gabbay wrote: > > > > 1) Setting sg_page to NULL > > > 2) 'mapping' pages for P2P DMA without going through the iommu > > > 3) Allowing P2P DMA without using the p2p dma API to validate that it > > > can work at all in the first place. > > > > > > All of these result in functional bugs in certain system > > > configurations. > > > > > > Jason > > > > Hi Jason, > > Thanks for the feedback. > > Regarding point 1, why is that a problem if we disable the option to > > mmap the dma-buf from user-space ? > > Userspace has nothing to do with needing struct pages or not > > Point 1 and 2 mostly go together, you supporting the iommu is not nice > if you dont have struct pages. > > You should study Logan's patches I pointed you at as they are solving > exactly this problem. Yes, I do need to study them. I agree with you here. It appears I have a hole in my understanding. I'm missing the connection between iommu support (which I must have of course) and struct pages. > > > In addition, I didn't see any problem with sg_page being NULL in the > > RDMA p2p dma-buf code. Did I miss something here ? > > No, the design of the dmabuf requires the exporter to do the dma maps > and so it is only the exporter that is wrong to omit all the iommu and > p2p logic. > > RDMA is OK today only because nobody has implemented dma buf support > in rxe/si - mainly because the only implementations of exporters don't Can you please educate me, what is rxe/si ? > set the struct page and are thus buggy. ok... so how come that patch-set was merged into 5.12 if it's buggy ? Because the current exporters are buggy ? I probably need a history lesson here. But I understand why you think it's a bad idea to add a new buggy exporter. > > > 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. > > Jason Yes, that's what I expect to see. But I want to see it with my own eyes and then figure out how to solve this. Maybe the result will be going to Logan's path, maybe something else, but I need to start by seeing the failure in a real system. Thanks for the information, it is really helpful. Oded From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 060AEC2B9F4 for ; Tue, 22 Jun 2021 15:24:57 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C8623600D1 for ; Tue, 22 Jun 2021 15:24:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C8623600D1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=amd-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 69B5A6E581; Tue, 22 Jun 2021 15:24:56 +0000 (UTC) Received: from mail-ot1-x332.google.com (mail-ot1-x332.google.com [IPv6:2607:f8b0:4864:20::332]) by gabe.freedesktop.org (Postfix) with ESMTPS id 101DD6E581; Tue, 22 Jun 2021 15:24:56 +0000 (UTC) Received: by mail-ot1-x332.google.com with SMTP id 7-20020a9d0d070000b0290439abcef697so21588549oti.2; Tue, 22 Jun 2021 08:24:56 -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; bh=4X+AcHyDDe3HhjQCq2G+eaJ8kvsIjHhuoyLFdEACcnQ=; b=F9cy62wh9RybK9h82fBHPpp8hPDnZx1s+Z0/GOTSU92eNMyNLfj1mmqR2+r3kT8aM1 xYDm3xoWuWMpBQnf+yCUtYaytLMGRdU+gDGi6swnU2/1W4YjA3DmVGgEJEhpqqWEJhiE 01z+W8Xkif0R9mOOrdnFJqQd5G+uUqQGTMfvsT/2xP5BWwkuBCnE6fDDDeJPKFj99hpa IUTx7/RubZA8kR6BUpUTkctQ7E0FSq1LJm9p8lS8IeiHhgNrTRG9ObqVGWK0oLwjI4ER nWl4Jh30VyNTX8WV9ruVKyd0scG13WLdSbrapyE0pKhuHbHyEx+IQYLAiGL9vT11KyaE aOoQ== 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; bh=4X+AcHyDDe3HhjQCq2G+eaJ8kvsIjHhuoyLFdEACcnQ=; b=Hg24sXjZJyQIh2lA2AJ+rJusCKu6v945U6TH39cxrHxL5mMm0zdNgQZXxEoiEVHRNG s1KYOfBHbTTp1CXuErFerLbOb8IG3fZm9sWoIkeKd/cYeHSw19SQELYjaR+7iC5nwMd1 LL3TC2jr6NyW2G9PMcR5HV0/TytJr9KfstQXeXtqqvUqNIpPmJdK8y6OLrxZucNgJG5w ZqVRji68jRZpIvphLfVUpnBpX6xc+6u5xBs8RKB0c8EJxJ9RuHT0+BAMS21RYVulCU+c AdjXptIQRhhLQoqLghSSNUAtH3K3t1wDHTYDGccdPwbNZagz4KjLe7Ga7GL87Z7Gq6YZ r81w== X-Gm-Message-State: AOAM533XnuhupFMy2A6OqRRK5FUkKnkt8wVzoqNy13jXHfPANI+9G+bU axiPfokEcXQ9i4lpt1I69e94l6yL5MAJkj71miI= X-Google-Smtp-Source: ABdhPJxdbW8W5cXUxxqtgxKi95nj/EmM2JjajNW5+/OukMinRa2g08LQoWclCFHmO/psGwfcUIox+YZCnLKA4tnM/9A= X-Received: by 2002:a9d:4581:: with SMTP id x1mr3651165ote.145.1624375495284; Tue, 22 Jun 2021 08:24:55 -0700 (PDT) MIME-Version: 1.0 References: <20210621175511.GI1096940@ziepe.ca> <20210621232912.GK1096940@ziepe.ca> <20210622120142.GL1096940@ziepe.ca> <20210622121546.GN1096940@ziepe.ca> <20210622151142.GA2431880@ziepe.ca> In-Reply-To: <20210622151142.GA2431880@ziepe.ca> From: Oded Gabbay Date: Tue, 22 Jun 2021 18:24:28 +0300 Message-ID: Subject: Re: [Linaro-mm-sig] [PATCH v3 1/2] habanalabs: define uAPI to export FD for DMA-BUF To: Jason Gunthorpe X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?Q?Christian_K=C3=B6nig?= , linux-rdma , =?UTF-8?Q?Christian_K=C3=B6nig?= , sleybo@amazon.com, Gal Pressman , dri-devel , Christoph Hellwig , "moderated list:DMA BUFFER SHARING FRAMEWORK" , Doug Ledford , Tomer Tayar , amd-gfx list , Greg KH , Alex Deucher , Leon Romanovsky , Oded Gabbay , Linux Kernel Mailing List , "open list:DMA BUFFER SHARING FRAMEWORK" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" On Tue, Jun 22, 2021 at 6:11 PM Jason Gunthorpe wrote: > > On Tue, Jun 22, 2021 at 04:12:26PM +0300, Oded Gabbay wrote: > > > > 1) Setting sg_page to NULL > > > 2) 'mapping' pages for P2P DMA without going through the iommu > > > 3) Allowing P2P DMA without using the p2p dma API to validate that it > > > can work at all in the first place. > > > > > > All of these result in functional bugs in certain system > > > configurations. > > > > > > Jason > > > > Hi Jason, > > Thanks for the feedback. > > Regarding point 1, why is that a problem if we disable the option to > > mmap the dma-buf from user-space ? > > Userspace has nothing to do with needing struct pages or not > > Point 1 and 2 mostly go together, you supporting the iommu is not nice > if you dont have struct pages. > > You should study Logan's patches I pointed you at as they are solving > exactly this problem. Yes, I do need to study them. I agree with you here. It appears I have a hole in my understanding. I'm missing the connection between iommu support (which I must have of course) and struct pages. > > > In addition, I didn't see any problem with sg_page being NULL in the > > RDMA p2p dma-buf code. Did I miss something here ? > > No, the design of the dmabuf requires the exporter to do the dma maps > and so it is only the exporter that is wrong to omit all the iommu and > p2p logic. > > RDMA is OK today only because nobody has implemented dma buf support > in rxe/si - mainly because the only implementations of exporters don't Can you please educate me, what is rxe/si ? > set the struct page and are thus buggy. ok... so how come that patch-set was merged into 5.12 if it's buggy ? Because the current exporters are buggy ? I probably need a history lesson here. But I understand why you think it's a bad idea to add a new buggy exporter. > > > 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. > > Jason Yes, that's what I expect to see. But I want to see it with my own eyes and then figure out how to solve this. Maybe the result will be going to Logan's path, maybe something else, but I need to start by seeing the failure in a real system. Thanks for the information, it is really helpful. Oded _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx