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 70CF3C43461 for ; Thu, 17 Sep 2020 15:35:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1D7F522247 for ; Thu, 17 Sep 2020 15:35:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="KItZq7TL" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728206AbgIQPeg (ORCPT ); Thu, 17 Sep 2020 11:34:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728183AbgIQPZG (ORCPT ); Thu, 17 Sep 2020 11:25:06 -0400 Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com [IPv6:2607:f8b0:4864:20::844]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7D73C06174A for ; Thu, 17 Sep 2020 08:24:58 -0700 (PDT) Received: by mail-qt1-x844.google.com with SMTP id 19so2184471qtp.1 for ; Thu, 17 Sep 2020 08:24:58 -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=/MIjfA84FROcmh2Yr+++vHpa0nobfYfMg9k42KNVp2M=; b=KItZq7TLRwXkeSUDV7TVakSYOYYpYVj1lFuOvU0VuV2nyeTZkDl+5SDk5YU6xRfdQb mmJrGXwRgXiqpqZBf8DLOJr/gMeGErqhZkM8rZSmNzY3KpK/NJt55cQb3C29WXfmsp40 KJdpWLxQBDyknwAoYt/ULy2EsSn//x6zNDDJW/sQmVP1idUubfNstwrhi9t017rZ3QZJ 3sDqFSKs5FzHiMnyyMyLtAnPX0Naf0m0oIbzEeYFHkliee0CZ1/6R0VN7TcyiVwxLFrO JOOOGOMacxM9ezg1v7YEt3scmLEmwNPGkyrd88i/jnPrnz/LvnJkdxDuuHZJUSvAh0TC tmSA== 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=/MIjfA84FROcmh2Yr+++vHpa0nobfYfMg9k42KNVp2M=; b=PLWxflWh2UkTADl3jUMP060BEYfifW7N0yd3UduT6c1pNn07tAbw9FSfhgb62bEsCw oE+bvek8qd/f/lY9M6DtJbs6DtcKnEzWJwGT35roD+ePTyvfmQq1S7O9pMm0v1Kx/skb HSYAM3NxI+iGXsIDL9pMSWvobXeads3Vu+fschEyH2dycYVAGyxdcjUSk28RiqXfSfYe H1LN3BUrax0h0YPUOizGv7m78koTdkZbsIxyzFK2RSooOOhicbiwWxn+p20K30SJLOjj aVQj/E/Thba24Bb7+elQsC/feDPsRyYP4d4HZ+a6ipRphGH5CR33x9TwdfVJyZJ+py6V ZNRQ== X-Gm-Message-State: AOAM531eoW7N9bJ/5VclHOSdQk0WxLiF74nyGL031seCGp64GamL8XCR eYsMYY3z6XepRtIMKJywE0DymQ== X-Google-Smtp-Source: ABdhPJyml2ehbabsQ2p5uBo50b15HPhlS1qE50x7EQpnsGFfmEF+Ym7+K38vhRLvzw2lQSd1AWRM1Q== X-Received: by 2002:ac8:5d04:: with SMTP id f4mr16143583qtx.290.1600356297898; Thu, 17 Sep 2020 08:24:57 -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 z74sm86638qkb.11.2020.09.17.08.24.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Sep 2020 08:24:57 -0700 (PDT) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1kIvmK-000VsL-KF; Thu, 17 Sep 2020 12:24:56 -0300 Date: Thu, 17 Sep 2020 12:24:56 -0300 From: Jason Gunthorpe To: christian.koenig@amd.com Cc: Linux Kernel Mailing List , dri-devel , "moderated list:DMA BUFFER SHARING FRAMEWORK" , Linux MM , Daniel Vetter , Andrew Morton , "open list:DMA BUFFER SHARING FRAMEWORK" Subject: Re: [Linaro-mm-sig] Changing vma->vm_file in dma_buf_mmap() Message-ID: <20200917152456.GH8409@ziepe.ca> References: <8d8693db-a3f0-4f5f-3e32-57d23ca620f8@amd.com> <20200917113110.GE8409@ziepe.ca> <6fd74b84-959c-8b3b-c27b-e9fbf66396c7@gmail.com> <20200917121858.GF8409@ziepe.ca> <20200917143551.GG8409@ziepe.ca> <5b330920-c789-fac7-e9b1-49f3bc1097a8@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5b330920-c789-fac7-e9b1-49f3bc1097a8@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 17, 2020 at 04:54:44PM +0200, Christian König wrote: > Am 17.09.20 um 16:35 schrieb Jason Gunthorpe: > > On Thu, Sep 17, 2020 at 02:24:29PM +0200, Christian König wrote: > > > Am 17.09.20 um 14:18 schrieb Jason Gunthorpe: > > > > On Thu, Sep 17, 2020 at 02:03:48PM +0200, Christian König wrote: > > > > > Am 17.09.20 um 13:31 schrieb Jason Gunthorpe: > > > > > > On Thu, Sep 17, 2020 at 10:09:12AM +0200, Daniel Vetter wrote: > > > > > > > > > > > > > Yeah, but it doesn't work when forwarding from the drm chardev to the > > > > > > > dma-buf on the importer side, since you'd need a ton of different > > > > > > > address spaces. And you still rely on the core code picking up your > > > > > > > pgoff mangling, which feels about as risky to me as the vma file > > > > > > > pointer wrangling - if it's not consistently applied the reverse map > > > > > > > is toast and unmap_mapping_range doesn't work correctly for our needs. > > > > > > I would think the pgoff has to be translated at the same time the > > > > > > vm->vm_file is changed? > > > > > > > > > > > > The owner of the dma_buf should have one virtual address space and FD, > > > > > > all its dma bufs should be linked to it, and all pgoffs translated to > > > > > > that space. > > > > > Yeah, that is exactly like amdgpu is doing it. > > > > > > > > > > Going to document that somehow when I'm done with TTM cleanups. > > > > BTW, while people are looking at this, is there a way to go from a VMA > > > > to a dma_buf that owns it? > > > Only a driver specific one. > > Sounds OK > > > > > For TTM drivers vma->vm_private_data points to the buffer object. Not sure > > > about the drivers using GEM only. > > Why are drivers in control of the vma? I would think dma_buf should be > > the vma owner. IIRC module lifetime correctness essentially hings on > > the module owner of the struct file > > Because the page fault handling is completely driver specific. > > We could install some DMA-buf vmops, but that would just be another layer of > redirection. If it is already taking a page fault I'm not sure the extra function call indirection is going to be a big deal. Having a uniform VMA sounds saner than every driver custom rolling something. When I unwound a similar mess in RDMA all the custom VMA stuff in the drivers turned out to be generally buggy, at least. Is vma->vm_file->private_data universally a dma_buf pointer at least? > > So, user VA -> find_vma -> dma_buf object -> dma_buf operations on the > > memory it represents > > Ah, yes we are already doing this in amdgpu as well. But only for DMA-bufs > or more generally buffers which are mmaped by this driver instance. So there is no general dma_buf service? That is a real bummer 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.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 6088FC43461 for ; Thu, 17 Sep 2020 15:25:01 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AE12F21973 for ; Thu, 17 Sep 2020 15:25:00 +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="KItZq7TL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AE12F21973 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id BD4846B0055; Thu, 17 Sep 2020 11:24:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B86116B005A; Thu, 17 Sep 2020 11:24:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A4CCF6B0062; Thu, 17 Sep 2020 11:24:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0232.hostedemail.com [216.40.44.232]) by kanga.kvack.org (Postfix) with ESMTP id 9056E6B0055 for ; Thu, 17 Sep 2020 11:24:59 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 42C438249980 for ; Thu, 17 Sep 2020 15:24:59 +0000 (UTC) X-FDA: 77272926318.28.neck59_0e15ce827123 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin28.hostedemail.com (Postfix) with ESMTP id 130DA6C0B for ; Thu, 17 Sep 2020 15:24:59 +0000 (UTC) X-HE-Tag: neck59_0e15ce827123 X-Filterd-Recvd-Size: 6691 Received: from mail-qt1-f194.google.com (mail-qt1-f194.google.com [209.85.160.194]) by imf15.hostedemail.com (Postfix) with ESMTP for ; Thu, 17 Sep 2020 15:24:58 +0000 (UTC) Received: by mail-qt1-f194.google.com with SMTP id k25so2169563qtu.4 for ; Thu, 17 Sep 2020 08:24:58 -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=/MIjfA84FROcmh2Yr+++vHpa0nobfYfMg9k42KNVp2M=; b=KItZq7TLRwXkeSUDV7TVakSYOYYpYVj1lFuOvU0VuV2nyeTZkDl+5SDk5YU6xRfdQb mmJrGXwRgXiqpqZBf8DLOJr/gMeGErqhZkM8rZSmNzY3KpK/NJt55cQb3C29WXfmsp40 KJdpWLxQBDyknwAoYt/ULy2EsSn//x6zNDDJW/sQmVP1idUubfNstwrhi9t017rZ3QZJ 3sDqFSKs5FzHiMnyyMyLtAnPX0Naf0m0oIbzEeYFHkliee0CZ1/6R0VN7TcyiVwxLFrO JOOOGOMacxM9ezg1v7YEt3scmLEmwNPGkyrd88i/jnPrnz/LvnJkdxDuuHZJUSvAh0TC tmSA== 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=/MIjfA84FROcmh2Yr+++vHpa0nobfYfMg9k42KNVp2M=; b=lmSSh8UWe6jtjwqYtYlaR0Fhy+yx2YT8s3v9+VE9AWjU9jSsNtNOthCUwjsjfNtjr6 OyZCYgYGMUixdhew9Ph+FSo5f1DM98k465ngI60q6GBeuTwPRccJ43loeXt2Qf3zxeEi y9ubVzR+P1lNDqwc4asdbBc/4HmnNtCP89lna4ZlyqMz04ruXT1f1cFXWcpbJe/mfKaT oM/iIdM5B2fnMcaKUm+0TryVeiDDSP6a3NX2p9G48JjtiiA6Rb+SoqjFm1zg8vLPreAG 9MrnegPvnmiSCwJg0Yy/VLpy3kr6zHcZBmiKCQ9rNraC/KPkD8bRxLfaHUKnqProTRqF gB2Q== X-Gm-Message-State: AOAM530eW0xbuBCWzFlrgRcf7rsw4OwynYhz6PuxORwXB9I5mNgrCxjV 4qtACzjFao3RyQKTgg73BRl2Yw== X-Google-Smtp-Source: ABdhPJyml2ehbabsQ2p5uBo50b15HPhlS1qE50x7EQpnsGFfmEF+Ym7+K38vhRLvzw2lQSd1AWRM1Q== X-Received: by 2002:ac8:5d04:: with SMTP id f4mr16143583qtx.290.1600356297898; Thu, 17 Sep 2020 08:24:57 -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 z74sm86638qkb.11.2020.09.17.08.24.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Sep 2020 08:24:57 -0700 (PDT) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1kIvmK-000VsL-KF; Thu, 17 Sep 2020 12:24:56 -0300 Date: Thu, 17 Sep 2020 12:24:56 -0300 From: Jason Gunthorpe To: christian.koenig@amd.com Cc: Linux Kernel Mailing List , dri-devel , "moderated list:DMA BUFFER SHARING FRAMEWORK" , Linux MM , Daniel Vetter , Andrew Morton , "open list:DMA BUFFER SHARING FRAMEWORK" Subject: Re: [Linaro-mm-sig] Changing vma->vm_file in dma_buf_mmap() Message-ID: <20200917152456.GH8409@ziepe.ca> References: <8d8693db-a3f0-4f5f-3e32-57d23ca620f8@amd.com> <20200917113110.GE8409@ziepe.ca> <6fd74b84-959c-8b3b-c27b-e9fbf66396c7@gmail.com> <20200917121858.GF8409@ziepe.ca> <20200917143551.GG8409@ziepe.ca> <5b330920-c789-fac7-e9b1-49f3bc1097a8@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <5b330920-c789-fac7-e9b1-49f3bc1097a8@gmail.com> X-Rspamd-Queue-Id: 130DA6C0B X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Sep 17, 2020 at 04:54:44PM +0200, Christian K=C3=B6nig wrote: > Am 17.09.20 um 16:35 schrieb Jason Gunthorpe: > > On Thu, Sep 17, 2020 at 02:24:29PM +0200, Christian K=C3=B6nig wrote: > > > Am 17.09.20 um 14:18 schrieb Jason Gunthorpe: > > > > On Thu, Sep 17, 2020 at 02:03:48PM +0200, Christian K=C3=B6nig wr= ote: > > > > > Am 17.09.20 um 13:31 schrieb Jason Gunthorpe: > > > > > > On Thu, Sep 17, 2020 at 10:09:12AM +0200, Daniel Vetter wrote= : > > > > > >=20 > > > > > > > Yeah, but it doesn't work when forwarding from the drm char= dev to the > > > > > > > dma-buf on the importer side, since you'd need a ton of dif= ferent > > > > > > > address spaces. And you still rely on the core code picking= up your > > > > > > > pgoff mangling, which feels about as risky to me as the vma= file > > > > > > > pointer wrangling - if it's not consistently applied the re= verse map > > > > > > > is toast and unmap_mapping_range doesn't work correctly for= our needs. > > > > > > I would think the pgoff has to be translated at the same time= the > > > > > > vm->vm_file is changed? > > > > > >=20 > > > > > > The owner of the dma_buf should have one virtual address spac= e and FD, > > > > > > all its dma bufs should be linked to it, and all pgoffs trans= lated to > > > > > > that space. > > > > > Yeah, that is exactly like amdgpu is doing it. > > > > >=20 > > > > > Going to document that somehow when I'm done with TTM cleanups. > > > > BTW, while people are looking at this, is there a way to go from = a VMA > > > > to a dma_buf that owns it? > > > Only a driver specific one. > > Sounds OK > >=20 > > > For TTM drivers vma->vm_private_data points to the buffer object. N= ot sure > > > about the drivers using GEM only. > > Why are drivers in control of the vma? I would think dma_buf should b= e > > the vma owner. IIRC module lifetime correctness essentially hings on > > the module owner of the struct file >=20 > Because the page fault handling is completely driver specific. > > We could install some DMA-buf vmops, but that would just be another lay= er of > redirection. If it is already taking a page fault I'm not sure the extra function call indirection is going to be a big deal. Having a uniform VMA sounds saner than every driver custom rolling something. When I unwound a similar mess in RDMA all the custom VMA stuff in the drivers turned out to be generally buggy, at least. Is vma->vm_file->private_data universally a dma_buf pointer at least? > > So, user VA -> find_vma -> dma_buf object -> dma_buf operations on th= e > > memory it represents >=20 > Ah, yes we are already doing this in amdgpu as well. But only for DMA-b= ufs > or more generally buffers which are mmaped by this driver instance. So there is no general dma_buf service? That is a real bummer 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.6 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 0345AC43464 for ; Thu, 17 Sep 2020 22:17:24 +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 AA28F20874 for ; Thu, 17 Sep 2020 22:17:23 +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="KItZq7TL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AA28F20874 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 24B9A6E41F; Thu, 17 Sep 2020 22:17:20 +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 CCB706EC48 for ; Thu, 17 Sep 2020 15:24:58 +0000 (UTC) Received: by mail-qt1-x842.google.com with SMTP id e7so2134158qtj.11 for ; Thu, 17 Sep 2020 08:24:58 -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=/MIjfA84FROcmh2Yr+++vHpa0nobfYfMg9k42KNVp2M=; b=KItZq7TLRwXkeSUDV7TVakSYOYYpYVj1lFuOvU0VuV2nyeTZkDl+5SDk5YU6xRfdQb mmJrGXwRgXiqpqZBf8DLOJr/gMeGErqhZkM8rZSmNzY3KpK/NJt55cQb3C29WXfmsp40 KJdpWLxQBDyknwAoYt/ULy2EsSn//x6zNDDJW/sQmVP1idUubfNstwrhi9t017rZ3QZJ 3sDqFSKs5FzHiMnyyMyLtAnPX0Naf0m0oIbzEeYFHkliee0CZ1/6R0VN7TcyiVwxLFrO JOOOGOMacxM9ezg1v7YEt3scmLEmwNPGkyrd88i/jnPrnz/LvnJkdxDuuHZJUSvAh0TC tmSA== 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=/MIjfA84FROcmh2Yr+++vHpa0nobfYfMg9k42KNVp2M=; b=jb0tPxWQaucmI+KAEgX+a4gBFFcEWnUPcsfOvyoYyfvZ+luPuoFanUSovqmkVpJVLo 799/Jepze0KTru1DuRGlMMBT10ZrpdD7IneFH4AyJn7xjiuGkyqKo/Lt/dupC+/xWXDP lyzx23IaiBl1zGW982d9CPAQOkY4AnGbbBS/AE/oWOZjR+gMXcRNaDNZIFj0IGhRRIYP psEF3OrBUTwte2NyM7RzlpXGojITRvQjUQ+kgvKa33qzdUq5zMFpMOrG9Xk3ph6BMMQl xjWzqvQ1DZXmeEqxSaEpifPFg4DGHuqs8XG5kCOptw+eGDtdzBdDZqTMoFHMwfum5iKK XooQ== X-Gm-Message-State: AOAM5334L222Kh/chqHhxbxTjf0t7Zf7sTapp1jBADGPQH7/jJ6Yo41y youMWZWfJSbRy6EjOw04RK4g0g== X-Google-Smtp-Source: ABdhPJyml2ehbabsQ2p5uBo50b15HPhlS1qE50x7EQpnsGFfmEF+Ym7+K38vhRLvzw2lQSd1AWRM1Q== X-Received: by 2002:ac8:5d04:: with SMTP id f4mr16143583qtx.290.1600356297898; Thu, 17 Sep 2020 08:24:57 -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 z74sm86638qkb.11.2020.09.17.08.24.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Sep 2020 08:24:57 -0700 (PDT) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1kIvmK-000VsL-KF; Thu, 17 Sep 2020 12:24:56 -0300 Date: Thu, 17 Sep 2020 12:24:56 -0300 From: Jason Gunthorpe To: christian.koenig@amd.com Subject: Re: [Linaro-mm-sig] Changing vma->vm_file in dma_buf_mmap() Message-ID: <20200917152456.GH8409@ziepe.ca> References: <8d8693db-a3f0-4f5f-3e32-57d23ca620f8@amd.com> <20200917113110.GE8409@ziepe.ca> <6fd74b84-959c-8b3b-c27b-e9fbf66396c7@gmail.com> <20200917121858.GF8409@ziepe.ca> <20200917143551.GG8409@ziepe.ca> <5b330920-c789-fac7-e9b1-49f3bc1097a8@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <5b330920-c789-fac7-e9b1-49f3bc1097a8@gmail.com> X-Mailman-Approved-At: Thu, 17 Sep 2020 22:17:03 +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: Linux Kernel Mailing List , dri-devel , "moderated list:DMA BUFFER SHARING FRAMEWORK" , Linux MM , Andrew Morton , "open list:DMA BUFFER SHARING FRAMEWORK" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" T24gVGh1LCBTZXAgMTcsIDIwMjAgYXQgMDQ6NTQ6NDRQTSArMDIwMCwgQ2hyaXN0aWFuIEvDtm5p ZyB3cm90ZToKPiBBbSAxNy4wOS4yMCB1bSAxNjozNSBzY2hyaWViIEphc29uIEd1bnRob3JwZToK PiA+IE9uIFRodSwgU2VwIDE3LCAyMDIwIGF0IDAyOjI0OjI5UE0gKzAyMDAsIENocmlzdGlhbiBL w7ZuaWcgd3JvdGU6Cj4gPiA+IEFtIDE3LjA5LjIwIHVtIDE0OjE4IHNjaHJpZWIgSmFzb24gR3Vu dGhvcnBlOgo+ID4gPiA+IE9uIFRodSwgU2VwIDE3LCAyMDIwIGF0IDAyOjAzOjQ4UE0gKzAyMDAs IENocmlzdGlhbiBLw7ZuaWcgd3JvdGU6Cj4gPiA+ID4gPiBBbSAxNy4wOS4yMCB1bSAxMzozMSBz Y2hyaWViIEphc29uIEd1bnRob3JwZToKPiA+ID4gPiA+ID4gT24gVGh1LCBTZXAgMTcsIDIwMjAg YXQgMTA6MDk6MTJBTSArMDIwMCwgRGFuaWVsIFZldHRlciB3cm90ZToKPiA+ID4gPiA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