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.9 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 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 CAC90C4363A for ; Mon, 26 Oct 2020 12:26:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 71FAB20882 for ; Mon, 26 Oct 2020 12:26:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="ZpyWLyYt" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1775095AbgJZM0n (ORCPT ); Mon, 26 Oct 2020 08:26:43 -0400 Received: from mail-qk1-f196.google.com ([209.85.222.196]:36514 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2442309AbgJZM0m (ORCPT ); Mon, 26 Oct 2020 08:26:42 -0400 Received: by mail-qk1-f196.google.com with SMTP id r7so8058578qkf.3 for ; Mon, 26 Oct 2020 05:26:41 -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:in-reply-to; bh=sFAWCcExMHTOHRRV6PN8qO5lJJu/poaIEUM21VQxEeo=; b=ZpyWLyYtOxl9708I/3m316/fIsDBjoAhyxwdOJlxJsIQp89vrJ1psU80YjbboMJ7f+ tjkXsGPp1n/tjrS7CO8YSh0BHMKyUL63RtYRbvtww00icDvInnKVld+7oqUZ9+TGlc6F fDw882W6OHcN4/prlG8d1si+B4vfUksndF/RKBd79O6i+A4Kk0TDArWp84D8tONbHwUO mjzsEQIK9YKqjijoHPI8dDym7XkPY3mjwJHpu56witca+ty26WsTaDlk50Tz3FaSzx+y iFM/9NSMb8xonezq2xpKJPKvrRGrNpyEg6Oc7kGTBlfyP5WaH+WvPUOYZYZL+VsZPtau HvBQ== 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=sFAWCcExMHTOHRRV6PN8qO5lJJu/poaIEUM21VQxEeo=; b=NjzxSghnlxzCCbHy/jNbgucEUT8MXs/XDLYy2T2CuaJIo5nnQmkqG231Ek2YxEIhye 9PHfYKqC9ApuVbDFavNyIM4RMvpl0GkFOeambNG1TjfImV5/1qlVX7DY5s20U1urqPPK 9DUdiuhsgZ7uw1mybgxUYGErcoTbrEe/P0Q6aB5aMaOdgSH8SUN5e4MArAuKgwhZsm0/ NPOdr9/ApA1Vj1BsGFTjE91EKPHPkHd5veaj4McczZVrOqEI/wbt6TWNQxsVZQKIDdZ7 Qo6Gj+dBzRcLC0p+KUX4yytpqCuHAinHmRLd+k22MamMLP6nwre7swxgEHI9vRq4YUL0 OG7A== X-Gm-Message-State: AOAM530fN2PgpfFEOjjSgc1Fim7TFBDBn3wrc7qZrq1MiwLv1GBdtAPN sUhePWow2P6FovLvzGBPyMCPnA== X-Google-Smtp-Source: ABdhPJwVw9RhhXxLcuyakL72UDPW4hT0r1fAS1TYVYmudNNMnoyPoutHDAwVmODEJzlfT62CHDCqmw== X-Received: by 2002:a05:620a:214b:: with SMTP id m11mr16914254qkm.6.1603715200851; Mon, 26 Oct 2020 05:26:40 -0700 (PDT) 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 y125sm6145331qkb.114.2020.10.26.05.26.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Oct 2020 05:26:38 -0700 (PDT) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1kX1a9-007zcj-SH; Mon, 26 Oct 2020 09:26:37 -0300 Date: Mon, 26 Oct 2020 09:26:37 -0300 From: Jason Gunthorpe To: Christoph Hellwig Cc: Daniel Vetter , Jianxin Xiong , linux-rdma@vger.kernel.org, dri-devel@lists.freedesktop.org, Leon Romanovsky , Doug Ledford , Daniel Vetter , Christian Koenig Subject: Re: [PATCH v6 1/4] RDMA/umem: Support importing dma-buf as user memory region Message-ID: <20201026122637.GQ36674@ziepe.ca> References: <1603471201-32588-1-git-send-email-jianxin.xiong@intel.com> <1603471201-32588-2-git-send-email-jianxin.xiong@intel.com> <20201023164911.GF401619@phenom.ffwll.local> <20201023182005.GP36674@ziepe.ca> <20201024074807.GA3112@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201024074807.GA3112@infradead.org> Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org On Sat, Oct 24, 2020 at 08:48:07AM +0100, Christoph Hellwig wrote: > On Fri, Oct 23, 2020 at 03:20:05PM -0300, Jason Gunthorpe wrote: > > The problem is we have RDMA drivers that assume SGL's have a valid > > struct page, and these hacky/wrong P2P sgls that DMABUF creates cannot > > be passed into those drivers. > > RDMA drivers do not assume scatterlist have a valid struct page, > scatterlists are defined to have a valid struct page. Any scatterlist > without a struct page is completely buggy. It is not just having the struct page, it needs to be a CPU accessible one for memcpy/etc. They aren't correct with the MEMORY_DEVICE_PCI_P2PDMA SGLs either. 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 DA086C5517A for ; Mon, 26 Oct 2020 18:01:56 +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 59BD4222C8 for ; Mon, 26 Oct 2020 18:01:56 +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="ZpyWLyYt" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 59BD4222C8 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 242956EA4B; Mon, 26 Oct 2020 18:01:49 +0000 (UTC) Received: from mail-qk1-x741.google.com (mail-qk1-x741.google.com [IPv6:2607:f8b0:4864:20::741]) by gabe.freedesktop.org (Postfix) with ESMTPS id BF72A6EA08 for ; Mon, 26 Oct 2020 12:26:41 +0000 (UTC) Received: by mail-qk1-x741.google.com with SMTP id q199so8030754qke.10 for ; Mon, 26 Oct 2020 05:26:41 -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:in-reply-to; bh=sFAWCcExMHTOHRRV6PN8qO5lJJu/poaIEUM21VQxEeo=; b=ZpyWLyYtOxl9708I/3m316/fIsDBjoAhyxwdOJlxJsIQp89vrJ1psU80YjbboMJ7f+ tjkXsGPp1n/tjrS7CO8YSh0BHMKyUL63RtYRbvtww00icDvInnKVld+7oqUZ9+TGlc6F fDw882W6OHcN4/prlG8d1si+B4vfUksndF/RKBd79O6i+A4Kk0TDArWp84D8tONbHwUO mjzsEQIK9YKqjijoHPI8dDym7XkPY3mjwJHpu56witca+ty26WsTaDlk50Tz3FaSzx+y iFM/9NSMb8xonezq2xpKJPKvrRGrNpyEg6Oc7kGTBlfyP5WaH+WvPUOYZYZL+VsZPtau HvBQ== 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=sFAWCcExMHTOHRRV6PN8qO5lJJu/poaIEUM21VQxEeo=; b=QU0zOwMNVSTaqwBKHh1EYV+LE8SvjDsqpSnRFOfWCfoBk0C/ZysH/3uKzWeqmremiJ u0nVA326uRbVtc2uA2ZImezFy44g5agQCJzoi4lCkAdF4e96OIZtYmKecWF9wgoGq3mp Vn0cK6kgEbjfyp+t9YoOXxHT4JAepJAAIg+lOrRGHggPEyC/wcS2XU7bBT9coQw00S/0 quypAmcgzdbK6K+9p4fFUHCBOUfKhn1WPGXLNVLYpKDDLYU9GINOL11ej03pTqDkE/4t nij6AWt/kgZPzI9noPKZQa5ue9NrLOi6tJrKmECNVlQ/GZy7PpCD7MvRWpaDZBt9T/vr pEZg== X-Gm-Message-State: AOAM533ucJaNH9RNnZ/VUlSGmCLLA+6e2Ml8Jfu8JOZeATLZlckz7zxk 1ZLKhPqXMYWfYQjiVejchR7fVQ== X-Google-Smtp-Source: ABdhPJwVw9RhhXxLcuyakL72UDPW4hT0r1fAS1TYVYmudNNMnoyPoutHDAwVmODEJzlfT62CHDCqmw== X-Received: by 2002:a05:620a:214b:: with SMTP id m11mr16914254qkm.6.1603715200851; Mon, 26 Oct 2020 05:26:40 -0700 (PDT) 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 y125sm6145331qkb.114.2020.10.26.05.26.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Oct 2020 05:26:38 -0700 (PDT) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1kX1a9-007zcj-SH; Mon, 26 Oct 2020 09:26:37 -0300 Date: Mon, 26 Oct 2020 09:26:37 -0300 From: Jason Gunthorpe To: Christoph Hellwig Subject: Re: [PATCH v6 1/4] RDMA/umem: Support importing dma-buf as user memory region Message-ID: <20201026122637.GQ36674@ziepe.ca> References: <1603471201-32588-1-git-send-email-jianxin.xiong@intel.com> <1603471201-32588-2-git-send-email-jianxin.xiong@intel.com> <20201023164911.GF401619@phenom.ffwll.local> <20201023182005.GP36674@ziepe.ca> <20201024074807.GA3112@infradead.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201024074807.GA3112@infradead.org> X-Mailman-Approved-At: Mon, 26 Oct 2020 18:01:45 +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 , Daniel Vetter , Christian Koenig , Jianxin Xiong Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Sat, Oct 24, 2020 at 08:48:07AM +0100, Christoph Hellwig wrote: > On Fri, Oct 23, 2020 at 03:20:05PM -0300, Jason Gunthorpe wrote: > > The problem is we have RDMA drivers that assume SGL's have a valid > > struct page, and these hacky/wrong P2P sgls that DMABUF creates cannot > > be passed into those drivers. > > RDMA drivers do not assume scatterlist have a valid struct page, > scatterlists are defined to have a valid struct page. Any scatterlist > without a struct page is completely buggy. It is not just having the struct page, it needs to be a CPU accessible one for memcpy/etc. They aren't correct with the MEMORY_DEVICE_PCI_P2PDMA SGLs either. Jason _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel