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 C4DC2C433E7 for ; Fri, 9 Oct 2020 18:03:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5BEDA22277 for ; Fri, 9 Oct 2020 18:03:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="f/szaRC+" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390380AbgJISDu (ORCPT ); Fri, 9 Oct 2020 14:03:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390339AbgJISBs (ORCPT ); Fri, 9 Oct 2020 14:01:48 -0400 Received: from mail-qv1-xf41.google.com (mail-qv1-xf41.google.com [IPv6:2607:f8b0:4864:20::f41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84818C0613D8 for ; Fri, 9 Oct 2020 11:01:48 -0700 (PDT) Received: by mail-qv1-xf41.google.com with SMTP id ev17so5179639qvb.3 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=g+5MHAKYebQXUGju7g2q+8pTOKLQEbUD4Lr1FAN6b0XgFQYEiZBTLmHP3wPA7RNEGL kQuascmCNQD+zcxgPegWAJH4LmFQFUTMTvSrGoZUO3N6bDHT6lV5fiJoM+8cblnAnVHs oEXPmA2whAvnZ5YMdVYn1yQQOFAvxPgSZK5UV/PdZzJDHtRIiHEvjQ/UVivz1o1uzdFd 2fVQU+qAz0Kzwry+OHR1r5pBGjAYkjoVBypjjmiEN+PxFy71FFp8zBtFpMiEHS80e8XP 8ivUdVTsXormrRH5dhoo/VcPfJIcvWgFonMCDfzUcn515r64oMjkZ21dtN3hSfvmVUOD oWsA== X-Gm-Message-State: AOAM532hNvPnt5hf93YAQHMp+Z784n584hPQGZGHhmUPx/MdmnbxvUG+ i8ZLrQgRmufX7eJxXI2yUxHCdQ== 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: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,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 D1CF7C433DF for ; Fri, 9 Oct 2020 18:03:43 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 391302158C for ; Fri, 9 Oct 2020 18:03:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="p7/w3DwP"; dkim=fail reason="signature verification failed" (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 391302158C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=iF3q9ZgrVZcSXMD5R+6HtZBcBG84zffZFxNNJ0ZPZag=; b=p7/w3DwPbBYvYfrm0vZMRa7nc 9/4nLu7dgAB5Z/MODRU4EsdAQhdL/n4xlyBT5iFpMIg2RAP+vkhIFVBYWo/COvvQ9vIppNCCV4m1h VSzliAkzzMSI3OlyE1SRmQUsLwBz4hulkDcSyj7KkIdGHxbFIgEDsDPaEQ/rOmrFzgxPaggjwH6ea wo6HMiVhlkt6VrnxmSCSKVdyrurV7AkBsW9PCo6uiqUc72kftcEUys1ATqfrZeuRUjuIutlbpYubo tsrFwBoh8ZRFDlKtQJefdLdniSqC5JovpmG08DHQuZp1NNpiZxI6cYbk+F+rXgfGY/drPXhz/63k8 R7mEySHaw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kQwiF-0001At-Tu; Fri, 09 Oct 2020 18:01:52 +0000 Received: from mail-qv1-xf44.google.com ([2607:f8b0:4864:20::f44]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kQwiD-00019y-Oi for linux-arm-kernel@lists.infradead.org; Fri, 09 Oct 2020 18:01:50 +0000 Received: by mail-qv1-xf44.google.com with SMTP id t20so5170114qvv.8 for ; Fri, 09 Oct 2020 11:01:49 -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=exB37i5Wpg/csV3klYXXlo9WTo8ctUeOCB9o71iKBW8NaRpeM+TWyTDj4GCYKGlW+Q ynXZjwLXKjdEglTSlfTX1Ed0KBgq3R/3W/UcW41R8YIUV9wrwYnHjGKg8K5aaK7+tlue hKbz+zkx5y8wFBnN8/agNFzhcK2QSTCNO1772GwHi+DMh2ihKZKEej6Iru51gkDfX4V9 vsfFyTsO65ih9RHAA+I8yll5EpN2Q13fj7QrEIAddM2VVM/AR311mbfwzL2zFV8vX5wK 7NvDtb+TgpK2ZW3g5Ahs+Z+TZ8m4W6945wnbIis3wjRckvtZdXeKlZHAowODfpTWvP3H sTPA== X-Gm-Message-State: AOAM530rKwMOFYxIpRAaPGw1Ry5YZ2QxOcRkCkbVLr4tBKU4c+sMl9g3 QKeuMpuq6cjtlWJCndRPKoxntPiGFR5VsIAU 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 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-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201009_140150_182675_79F475EC X-CRM114-Status: GOOD ( 24.90 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-s390 , linux-samsung-soc , Jan Kara , Kees Cook , KVM list , Mauro Carvalho Chehab , John Hubbard , LKML , DRI Development , Linux MM , =?utf-8?B?SsOpcsO0bWU=?= Glisse , Daniel Vetter , Dan Williams , Linus Torvalds , Andrew Morton , Linux ARM , "open list:DMA BUFFER SHARING FRAMEWORK" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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 0D2D7C433DF for ; Sat, 10 Oct 2020 10:03:27 +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 BD4ED21D41 for ; Sat, 10 Oct 2020 10:03:26 +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="f/szaRC+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BD4ED21D41 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 313B36EEA4; Sat, 10 Oct 2020 10:03:01 +0000 (UTC) Received: from mail-qv1-xf44.google.com (mail-qv1-xf44.google.com [IPv6:2607:f8b0:4864:20::f44]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7FED46ED76 for ; Fri, 9 Oct 2020 18:01:48 +0000 (UTC) Received: by mail-qv1-xf44.google.com with SMTP id 13so5157222qvc.9 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=T8PZSzM/7YpelikDDHK+EjDN/Lyqe1V2E25cCrlZyipb3n15WOalb3nhhrmFOZHo0m 6/kAzsDAqq6bx0y1jqozYlEOAzw7JI3siu+L8+7+GA6uN+DYBhVHJVGMlHFi1EUddmef ov23xs2BUnTnGP5Rh3D7MLTMjU82VIxsivcmljeVICDdt1BU+GGSBewCZP28CTq05sIt Mdb7mmYmMba9kJDvDksP1aJO/MccqnpzeYfNx6rOjRAkZWj9VAGQpwmxduiNZ2a6o9Xe yYNwuzqIurfGmBsHLrnG4ESKc7u4Rwz+7acwxiSOzLmU4X2eSn9HgqxYbY6vMfX9/kgx 5h7g== X-Gm-Message-State: AOAM5312rYmFaA9fWNqJx1+goxf7UPcAQvgHuFZvA/mmynIFVHxe64jR I1V/C1IL0F/GpR/8u6BAHJVY5A== 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 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-Disposition: inline In-Reply-To: X-Mailman-Approved-At: Sat, 10 Oct 2020 10:02:57 +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-s390 , linux-samsung-soc , Jan Kara , Kees Cook , KVM list , Mauro Carvalho Chehab , John Hubbard , LKML , DRI Development , Linux MM , =?utf-8?B?SsOpcsO0bWU=?= Glisse , Daniel Vetter , Dan Williams , Linus Torvalds , Andrew Morton , Linux ARM , "open list:DMA BUFFER SHARING FRAMEWORK" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel