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 5D8ABC433DF for ; Fri, 9 Oct 2020 18:01:51 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 94F3521D6C for ; Fri, 9 Oct 2020 18:01:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="f/szaRC+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 94F3521D6C 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 E7D7A6B006C; Fri, 9 Oct 2020 14:01:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E2CB08E0001; Fri, 9 Oct 2020 14:01:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CCE9E6B0071; Fri, 9 Oct 2020 14:01:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0201.hostedemail.com [216.40.44.201]) by kanga.kvack.org (Postfix) with ESMTP id 9C6B66B006C for ; Fri, 9 Oct 2020 14:01:49 -0400 (EDT) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 2F6AC8249980 for ; Fri, 9 Oct 2020 18:01:49 +0000 (UTC) X-FDA: 77353155138.11.floor18_4909684271e2 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin11.hostedemail.com (Postfix) with ESMTP id 0FE00180F8B82 for ; Fri, 9 Oct 2020 18:01:49 +0000 (UTC) X-HE-Tag: floor18_4909684271e2 X-Filterd-Recvd-Size: 5653 Received: from mail-qv1-f67.google.com (mail-qv1-f67.google.com [209.85.219.67]) by imf37.hostedemail.com (Postfix) with ESMTP for ; Fri, 9 Oct 2020 18:01:48 +0000 (UTC) Received: by mail-qv1-f67.google.com with SMTP id j3so5163492qvi.7 for ; Fri, 09 Oct 2020 11:01:48 -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=JtTniNbWimQFTlPWxNfhtRJTUnIfWE2pIrRn0nLquTU=; b=f/szaRC+vLdnDgqFvq8AOddrp6VSsc5+VOKHgdN1Blfz+Kdocq0LgJzoYOwFNRhbsb R58LfaQQ3n9+kujlpK+dXsyPtLR7PpkdHaoMjpLP5dFUu9uKpYtIgwUv2SzANG3wJ4HI uZ2jIrHb3l+wKyafHdJPZ5UpeQcq4bXudJq3VH1qWYsmCJKZjK3dkCknvRMRvHtmwEaJ +C7ytvDBDqqX8xISydsOLSJIZQl1e2A9hJato/1mUA5uyCKy3VQWCdd1nWlOILZ9XItf xtRqWEAdtlSCbEhxBM5pVhNugecQkdco1xNKTq95myZ76QxSJibw5Xyqk8ww4uW9rkwK T0kw== 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=JtTniNbWimQFTlPWxNfhtRJTUnIfWE2pIrRn0nLquTU=; b=eTmaw9PwWVz++5cB/i801pn5aRpxmMdql3eSmcCA1qf8q5/bo0hMA4H3VHtbRkhA0F dK4u9qcHvyDn4n0EWJtw20J+cgspvxawMCE8v80ngsNL37Sw+KBSLeh5VaqHW7lsrIFK f4KHYjUGXXahS+Ek06DAkX52UAjJ+N4oHTLTFeRS+cqEpv3K9y8Sq2UgAUhX/mdboD3i rIMfBGQ5VKgnb+HtChoWdKZIf6LxkwzWF/tjqoAJ1xkWq2kDU3xp1IEckUHjJT94218E 77fg7SmBEM4TldNswPHb7lZowFCTiWynS2y6D/PxEB18vkThZYqrfgnO10wsPLtNtl/O WMag== X-Gm-Message-State: AOAM532fC8AOpEMPUVWw1rv7SD8tOHys3SjtzSvtdhsIGqsqGmeqsEyV /h7N/44gw/wNhDoG18podJUATA== X-Google-Smtp-Source: ABdhPJwGH8DcAarR0OMfhGw63SRnoeGEeh/DF4k79ebCsxHoTPcqFkl2Atp6g4SjeQTYysb9k3E+GQ== X-Received: by 2002:ad4:52c6:: with SMTP id p6mr12553168qvs.38.1602266507532; Fri, 09 Oct 2020 11:01:47 -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 68sm6690974qkg.108.2020.10.09.11.01.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Oct 2020 11:01:46 -0700 (PDT) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1kQwi9-002b28-P5; Fri, 09 Oct 2020 15:01:45 -0300 Date: Fri, 9 Oct 2020 15:01:45 -0300 From: Jason Gunthorpe To: Daniel Vetter Cc: Mauro Carvalho Chehab , DRI Development , LKML , KVM list , Linux MM , Linux ARM , linux-samsung-soc , "open list:DMA BUFFER SHARING FRAMEWORK" , linux-s390 , Daniel Vetter , Kees Cook , Dan Williams , Andrew Morton , John Hubbard , =?utf-8?B?SsOpcsO0bWU=?= Glisse , Jan Kara , Linus Torvalds Subject: Re: [PATCH v2 09/17] mm: Add unsafe_follow_pfn Message-ID: <20201009180145.GB5177@ziepe.ca> References: <20201009075934.3509076-1-daniel.vetter@ffwll.ch> <20201009075934.3509076-10-daniel.vetter@ffwll.ch> <20201009123421.67a80d72@coco.lan> <20201009122111.GN5177@ziepe.ca> <20201009143723.45609bfb@coco.lan> <20201009124850.GP5177@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Fri, Oct 09, 2020 at 07:52:05PM +0200, Daniel Vetter wrote: > > > If this is the case, the proper fix seems to have a GFP_NOT_MOVABLE > > > flag that it would be denying the core mm code to set __GFP_MOVABLE. > > > > We can't tell from the VMA these kinds of details.. > > > > It has to go the other direction, evey mmap that might be used as a > > userptr here has to be found and the VMA specially created to allow > > its use. At least that is a kernel only change, but will need people > > with the HW to do this work. > > I think the only reasonable way to keep this working is: > - add a struct dma_buf *vma_tryget_dma_buf(struct vm_area_struct *vma); > - add dma-buf export support to fbdev and v4l > - roll this out everywhere we still need it. It seems to me there is a technical way forward to restore user compat, so it is really no different than RDMA/DRM pain we both suffered before. Thus no justification to NAK it. If media wants things to keep working they have to do the technical path like you outline above. > Realistically this just isn't going to happen. If your series goes ahead it will get solved. Someone will take on the huge project to either add DMA buf to the drivers people still care about, or do the work above to transparently handle in kernel. If we allow things to keep working without consequence then nobody will do it. The only reason we did the 4 years of work in RDMA was because Linus went in and broke the uABI for a security fix. It was hundreds of patches to fix it, so I don't have much sympathy for "it is too hard" here. Jason