Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp3475051pxu; Sun, 11 Oct 2020 11:01:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzX0AQY+H+GnO235GX+87ZR0Iv0NPCvfzsRzTtBIdwpH1LgD9f5FqMP6nzjBpdF+1s5wtBs X-Received: by 2002:a17:906:190b:: with SMTP id a11mr24369081eje.260.1602439269210; Sun, 11 Oct 2020 11:01:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602439269; cv=none; d=google.com; s=arc-20160816; b=cmhtyhEQY2a3Qo2MzqKPp23DJI2ivQAAtkZCSYX66x19uyXrcZ+iHUw2eEAEMGdd5r 4gJKWrDVJtusTcYJN+myPDV1rEU0w9yLtCYXopM9kV2F8k375mShK3G6ll9uwWc9+6HL kHsDJ7IB2of7f2g6aXuou0P2prC2yrRfRglwl26X+n6GdUssorMYOZdamsDPtYiG4kXt vT5bVRtQ2/hXSmfcswfb+stWgRSad8nhfytwP1Nm1M9H/nktcKqYb/iOpISxxOrRaHwp JMyF6MSkZFhbY7Up+wxaEqjELRNY8ROT2TVDmhmufDMxotew3xmOnT2pp18CohS2nZl5 4Yvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=ipy5RgDcF4JBLV/+ATmwQF9m6u4RDNSJuYvxoSOOb7U=; b=abD6HUw32fAXSGJ49bT19Wis9JPHwlcdVW7Y+8/oEFw5nIvFalKvT2pBbzldwWXFa0 dJmoNoFsH/SFA9Doah33z+iNppX/G+lQFC0yGjexi9JAQ2vAy81SWXozrXlXTi7jqBNw flswsVYUd+j1jNQrHfB7p6xoMCVmPtC1j43x6jAigEnA0XxJw8w3u8EnmBWmECu05Az+ kmPGZXJxRF7ocV9Aj/glVLPHbQpxBnhjCu0YsXAuGJq9jX5B7bcuB2Hz+iaNQ1vDdalm BaRIUYEbhHWDe8swQapdv2gM82mjyGRabnxuFUZie8Y0EOCBku6183DYjZrRqdxdoeH+ WTCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jvBUfU4l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k25si13112133ejk.10.2020.10.11.11.00.46; Sun, 11 Oct 2020 11:01:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jvBUfU4l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728391AbgJKGgv (ORCPT + 99 others); Sun, 11 Oct 2020 02:36:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:50790 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726342AbgJKGgv (ORCPT ); Sun, 11 Oct 2020 02:36:51 -0400 Received: from coco.lan (ip5f5ad5a3.dynamic.kabel-deutschland.de [95.90.213.163]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 85DE0207F7; Sun, 11 Oct 2020 06:36:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602398210; bh=MR/RMyKCclUPPVflq9R7vQAnP0HHAB+V0k+M/bUhRS4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=jvBUfU4lcFH5iYVZHi3aofMRqu0bNvwHTxzGNNkxsyXYWj1btiksG20/jfbPQvvqv dVJGVqnV9hei4ZzzcKLtrrL3N/xYb6tuVCokS0XC+GSZbVjKBxNL+vnz8aAokYiVaa RWkpl0Kn6+L8/zgpVMrCrzOooLkal8LZO9av0isI= Date: Sun, 11 Oct 2020 08:36:42 +0200 From: Mauro Carvalho Chehab To: Daniel Vetter Cc: Laurent Pinchart , Tomasz Figa , linux-s390 , linux-samsung-soc , Jan Kara , Kees Cook , KVM list , Linux MM , John Hubbard , LKML , DRI Development , Jason Gunthorpe , =?UTF-8?B?SsOpcsO0bWU=?= Glisse , Daniel Vetter , Dan Williams , Linus Torvalds , Andrew Morton , Linux ARM , "open list:DMA BUFFER SHARING FRAMEWORK" , Hans Verkuil , "Lad, Prabhakar" Subject: Re: [PATCH v2 09/17] mm: Add unsafe_follow_pfn Message-ID: <20201011083642.06ea8062@coco.lan> In-Reply-To: <20201011082741.6bed4d71@coco.lan> 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> <20201010213554.GD3939@pendragon.ideasonboard.com> <20201011082741.6bed4d71@coco.lan> X-Mailer: Claws Mail 3.17.6 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Sun, 11 Oct 2020 08:27:41 +0200 Mauro Carvalho Chehab escreveu: > Em Sat, 10 Oct 2020 23:50:27 +0200 > Daniel Vetter escreveu: > > > On Sat, Oct 10, 2020 at 11:36 PM Laurent Pinchart > > wrote: > > > > > > > > We probably still have a few legacy drivers using videobuf (non-2), > > > > but IMHO those should be safe to put behind some disabled-by-default > > > > Kconfig symbol or even completely drop, as the legacy framework has > > > > been deprecated for many years already. > > > > > > There's 8 drivers left, and they support a very large number of devices. > > > I expect unhappy users distros stop shipping them. On the other hand, > > > videobuf has been deprecated for a loooooooong time, so there has been > > > plenty of time to convert the remaining drivers to videobuf2. If nobody > > > can do it, then we'll have to drop support for these devices given the > > > security issues. > > > > Again, the issue here is _only_ with follow_pfn. For videobuf1 this > > means videbuf-dma-contig.c userptr support is broken. Unlike videobuf2 > > it means it's broken for all usage (not just zero-copy userptr), > > because videbuf-dma-contig.c lacks the pin_user_pages path. > > Well, follow_pfn() is used only by videbuf-dma-contig.c. If this is > the only part of VB1 that will have userptr broken, then there's > just one driver that might be affected: davinci. > > Yet, taking a deeper look: > > $ git grep include drivers/media/platform/davinci/|grep -i videobuf > drivers/media/platform/davinci/vpif_capture.h:#include > drivers/media/platform/davinci/vpif_display.h:#include > > It sounds to me that it was already converted to VB2, but some VB1 > symbols were not converted at its Kconfig. > > It sounds to me that there are other drivers with some VB1 left overs > at Kconfig, as those are the only ones using VB1 those days: > > $ for i in $(git grep media/videobuf drivers |grep -v videobuf2 |grep -v v4l2-core|cut -d: -f1); do dirname $i; done|sort|uniq > drivers/media/pci/bt8xx > drivers/media/pci/cx18 > drivers/media/platform > drivers/media/usb/tm6000 > drivers/media/usb/zr364xx > drivers/staging/media/atomisp/pci This is incomplete. There are two drivers that include videobuf indirectly: include/media/davinci/vpfe_capture.h include/media/drv-intf/saa7146_vv.h I double-checked that DaVinci still uses VB1. There are actually two clients for videbuf-dma-contig.c: davinci and fsl-viu. Those two will be affected, if we don't add pin_user_pages_fast() support to VB1 or convert them to VB2. > > > But that > > would be easy to add if this poses a problem I think - we just need > > to carry over the pin_user_pages_fast logic from videbuf2, no driver > > changes required. But of course I don't think we should do that before > > someone reports the regression, since videobuf1 userptr is doubly > > deprecated :-) > > I think otherwise. Keeping a broken component at the Kernel is > a bad idea. > > Yet, from my quick search above, it sounds to me that it is time for > us to retire the VB1 DMA contig support as a hole, as there's no client > for it anymore. > > I'll work on some patches cleaning up the VB1 left overs at > Kconfig and removing videbuf-dma-contig.c for good, if there's > no hidden dependency on it. > > > Thanks, > Mauro Thanks, Mauro