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=-3.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 0D565C388F7 for ; Tue, 10 Nov 2020 14:28:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9E38D206C0 for ; Tue, 10 Nov 2020 14:28:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="NMsQyGZR" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730819AbgKJO2A (ORCPT ); Tue, 10 Nov 2020 09:28:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732072AbgKJO2A (ORCPT ); Tue, 10 Nov 2020 09:28:00 -0500 Received: from mail-qt1-x843.google.com (mail-qt1-x843.google.com [IPv6:2607:f8b0:4864:20::843]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA58EC0613CF for ; Tue, 10 Nov 2020 06:27:59 -0800 (PST) Received: by mail-qt1-x843.google.com with SMTP id v11so8252069qtq.12 for ; Tue, 10 Nov 2020 06:27:59 -0800 (PST) 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:in-reply-to; bh=mL4lHv4v6f7ZT4BJN8nX+avMz3HLjn+2qjGZAHM9Z+o=; b=NMsQyGZRP8MA81MNTiqD4NmvGrh4bo/w7mpW0Del/iZHZ769dPT6nPSfLNoTlShC0V fJNxo5Orw31ladk9afZ+RlXucSDYYo+cqFvjo5r7jcwE5hYwDNDc34Xt9GqAiEGszqJy HVfpgEbvUXXUlx15YcVyFuSmolf65MxRNBbN/joq686WTKE4EHoAk3SZ0YJ+O+Yvjf83 tqfhkDlIiMfjV46YViu4C5B0xr/B1ZGfPubgrH/ecEaYA7zAKX5lGScZrPXCcehj/7oz olrobO5nom/dyIj7+SxHIWaKX4qrBqs5nBbTs4iEVYkPzDr3Abjt3YSTckUXWZ364FCi +Kng== 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:in-reply-to; bh=mL4lHv4v6f7ZT4BJN8nX+avMz3HLjn+2qjGZAHM9Z+o=; b=JmKDh9NFSDucQwkgTKvHkZE1utQzXe1o9ZflKTsT6Nn5X8A291RzvNv9upOokteOmr 0msQPWpzdSDINU3F09ACZn/46UX0cl+I1DCutl/tqMr0bTa0fVC6z2hR4075yHL2rEYs C9WfFjR1z8PdxFJJiMAk0OZss0bYJkjSVGWSovdnzo3K2eX79n6A4nSOC4EeDsGIVWYp CKKlYtDq3s3YEhVK9OMmxdpsQ6ajELJ616yn6g4MJZu+pc2SZl108lEYB/eauXVjzyiX MaNvos4JmJdAgtiqAxGauT4IskR0eCCKtzx/79G11VgClXcdvKmqmRjOix1p+9tMBaUG X33g== X-Gm-Message-State: AOAM532J/rNSCok7FNWEZKa2ZuqAXHXw+JfHoBT5OiBAUE4yL8YFLARH lJC1q9b9GM5+rURqRq7mSsZAgg== X-Google-Smtp-Source: ABdhPJxh9+6ksgH2lz+e9lvXOPrbzU81X5xD8AgBcSFWVDxLuvjMedgLvA+MtOTKtFH6hCzrYj8XJA== X-Received: by 2002:ac8:7b92:: with SMTP id p18mr18057108qtu.105.1605018479024; Tue, 10 Nov 2020 06:27:59 -0800 (PST) Received: from ziepe.ca (hlfxns017vw-156-34-48-30.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.48.30]) by smtp.gmail.com with ESMTPSA id g11sm8255376qkl.30.2020.11.10.06.27.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Nov 2020 06:27:58 -0800 (PST) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1kcUcn-002QwA-KP; Tue, 10 Nov 2020 10:27:57 -0400 Date: Tue, 10 Nov 2020 10:27:57 -0400 From: Jason Gunthorpe To: Daniel Vetter Cc: "Xiong, Jianxin" , Leon Romanovsky , "linux-rdma@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , Doug Ledford , "Vetter, Daniel" , Christian Koenig Subject: Re: [PATCH v8 1/5] RDMA/umem: Support importing dma-buf as user memory region Message-ID: <20201110142757.GM244516@ziepe.ca> References: <1604616489-69267-1-git-send-email-jianxin.xiong@intel.com> <1604616489-69267-2-git-send-email-jianxin.xiong@intel.com> <20201106000851.GK36674@ziepe.ca> <20201106163953.GR36674@ziepe.ca> <20201110141445.GI401619@phenom.ffwll.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201110141445.GI401619@phenom.ffwll.local> Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org On Tue, Nov 10, 2020 at 03:14:45PM +0100, Daniel Vetter wrote: > On Fri, Nov 06, 2020 at 12:39:53PM -0400, Jason Gunthorpe wrote: > > On Fri, Nov 06, 2020 at 04:34:07PM +0000, Xiong, Jianxin wrote: > > > > > > The user could specify a length that is beyond the dma buf, can > > > > the dma buf length be checked during get? > > > > > > In order to check the length, the buffer needs to be mapped. That can be done. > > > > Do DMA bufs even have definitate immutable lengths? Going to be a > > probelm if they can shrink > > Yup. Unfortunately that's not document in the structures themselves, > there's just some random comments sprinkled all over that dma-buf size is > invariant, e.g. see the @mmap kerneldoc in dma_buf_ops: > > https://dri.freedesktop.org/docs/drm/driver-api/dma-buf.html?highlight=dma_buf_ops#c.dma_buf_ops > > "Because dma-buf buffers have invariant size over their lifetime, ..." > > Jianxin, can you pls do a kerneldoc patch which updates the comment for > dma_buf.size and dma_buf_export_info.size? So we can check the size without doing an attachment? That means the flow should be put back to how it was a series or two ago where the SGL is only attached during page fault with the entire programming sequence under the resv lock Jason 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=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 52D07C4742C for ; Wed, 11 Nov 2020 07:56:12 +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 CDC96206B5 for ; Wed, 11 Nov 2020 07:56:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="NMsQyGZR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CDC96206B5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca 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 4400C89F71; Wed, 11 Nov 2020 07:55:03 +0000 (UTC) Received: from mail-qt1-x842.google.com (mail-qt1-x842.google.com [IPv6:2607:f8b0:4864:20::842]) by gabe.freedesktop.org (Postfix) with ESMTPS id E87C289B67 for ; Tue, 10 Nov 2020 14:27:59 +0000 (UTC) Received: by mail-qt1-x842.google.com with SMTP id f93so8630926qtb.10 for ; Tue, 10 Nov 2020 06:27:59 -0800 (PST) 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:in-reply-to; bh=mL4lHv4v6f7ZT4BJN8nX+avMz3HLjn+2qjGZAHM9Z+o=; b=NMsQyGZRP8MA81MNTiqD4NmvGrh4bo/w7mpW0Del/iZHZ769dPT6nPSfLNoTlShC0V fJNxo5Orw31ladk9afZ+RlXucSDYYo+cqFvjo5r7jcwE5hYwDNDc34Xt9GqAiEGszqJy HVfpgEbvUXXUlx15YcVyFuSmolf65MxRNBbN/joq686WTKE4EHoAk3SZ0YJ+O+Yvjf83 tqfhkDlIiMfjV46YViu4C5B0xr/B1ZGfPubgrH/ecEaYA7zAKX5lGScZrPXCcehj/7oz olrobO5nom/dyIj7+SxHIWaKX4qrBqs5nBbTs4iEVYkPzDr3Abjt3YSTckUXWZ364FCi +Kng== 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:in-reply-to; bh=mL4lHv4v6f7ZT4BJN8nX+avMz3HLjn+2qjGZAHM9Z+o=; b=PxN/y0w/3QQBbLyqxmOiNFp3ygtgdxyQ6zo57oGGbZcu6aH+pXoE/tq1bFmZTGFNhC LLr+z5CrfbdKBbGqlsgNB32vUngifBTPiO1WPTPGsx5q26wpJ7QzLxqlOGb5WIoS7fSS Qt9bxz/bdmTGuOKrjM6zkrqPp9mdue2XQWhNLVn4fq7NHw3794/snDfpEReUCgg99i/R 1dffYEKB314ZCouP3iDt3VG2k32DWDdbaIkEoPI7meWIZV+ZPw/ySPRXlQyZB+bmaz0x /Yf43uyDtUMy6CrIzz1SFs3IwoT3yk/W35aVpzVCYUzLHKmKphyFOixj1GTiD5KmHAIK tiyg== X-Gm-Message-State: AOAM533+UMAvDIYTu5dGEAYq/NrF+8Ql2o8r4NwgztBMHb112Zf6QTa0 j3J3DvxQlTYmVpN39sLWRQkkTw== X-Google-Smtp-Source: ABdhPJxh9+6ksgH2lz+e9lvXOPrbzU81X5xD8AgBcSFWVDxLuvjMedgLvA+MtOTKtFH6hCzrYj8XJA== X-Received: by 2002:ac8:7b92:: with SMTP id p18mr18057108qtu.105.1605018479024; Tue, 10 Nov 2020 06:27:59 -0800 (PST) Received: from ziepe.ca (hlfxns017vw-156-34-48-30.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.48.30]) by smtp.gmail.com with ESMTPSA id g11sm8255376qkl.30.2020.11.10.06.27.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Nov 2020 06:27:58 -0800 (PST) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1kcUcn-002QwA-KP; Tue, 10 Nov 2020 10:27:57 -0400 Date: Tue, 10 Nov 2020 10:27:57 -0400 From: Jason Gunthorpe To: Daniel Vetter Subject: Re: [PATCH v8 1/5] RDMA/umem: Support importing dma-buf as user memory region Message-ID: <20201110142757.GM244516@ziepe.ca> References: <1604616489-69267-1-git-send-email-jianxin.xiong@intel.com> <1604616489-69267-2-git-send-email-jianxin.xiong@intel.com> <20201106000851.GK36674@ziepe.ca> <20201106163953.GR36674@ziepe.ca> <20201110141445.GI401619@phenom.ffwll.local> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201110141445.GI401619@phenom.ffwll.local> X-Mailman-Approved-At: Wed, 11 Nov 2020 07:54:43 +0000 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: Leon Romanovsky , "linux-rdma@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , Doug Ledford , "Vetter, Daniel" , Christian Koenig , "Xiong, Jianxin" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Tue, Nov 10, 2020 at 03:14:45PM +0100, Daniel Vetter wrote: > On Fri, Nov 06, 2020 at 12:39:53PM -0400, Jason Gunthorpe wrote: > > On Fri, Nov 06, 2020 at 04:34:07PM +0000, Xiong, Jianxin wrote: > > > > > > The user could specify a length that is beyond the dma buf, can > > > > the dma buf length be checked during get? > > > > > > In order to check the length, the buffer needs to be mapped. That can be done. > > > > Do DMA bufs even have definitate immutable lengths? Going to be a > > probelm if they can shrink > > Yup. Unfortunately that's not document in the structures themselves, > there's just some random comments sprinkled all over that dma-buf size is > invariant, e.g. see the @mmap kerneldoc in dma_buf_ops: > > https://dri.freedesktop.org/docs/drm/driver-api/dma-buf.html?highlight=dma_buf_ops#c.dma_buf_ops > > "Because dma-buf buffers have invariant size over their lifetime, ..." > > Jianxin, can you pls do a kerneldoc patch which updates the comment for > dma_buf.size and dma_buf_export_info.size? So we can check the size without doing an attachment? That means the flow should be put back to how it was a series or two ago where the SGL is only attached during page fault with the entire programming sequence under the resv lock Jason _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel