Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4446235pxf; Tue, 16 Mar 2021 13:46:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw3Mi3PZZyi+KBBSY9LC7bFBEUVkp6Ug/nte5bE+DR716Oclzoxu1Q4is1h4A6F1gh68OQI X-Received: by 2002:a17:906:5450:: with SMTP id d16mr21324597ejp.274.1615927617381; Tue, 16 Mar 2021 13:46:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615927617; cv=none; d=google.com; s=arc-20160816; b=0zHyOM9QysTXp/SKvLcZdiFmYUp4PjlFiryuZduWQMrd0U36AZ2OfCBc8UgoTgjWv8 sZ2LfSEWGLWBXCnYH1lwSFxJtXSUL4DQhQG0Su+qXe7gCV6WXoYnzwrqIAQYjIs10Efj PrpA4qIzZhC7f6KPZr82Ihseue+5ZEZec1PBw1+nv5JKrI5UUhUHSJuVO6VoOay+uvmO 7oF8X+R6qVhoVDMJhquAsNEU9R75uZZAzzZCcGlshNEUqUhLhBF5StTM8wyxtgyfkuei DkArbt8Yy5AWOe2uSXp5l2V/tOsxna2qrQ20RCfYdBb8pNN7xeGzvbDIKLMolxZS1hzP XzZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=H9qbH69IBoptMfn8E8EI/JvkYdGz2fb3BHGazwe2dlM=; b=SWeMpCxDVKh1H3nHOt4zxCyh+uloa3gZYX+Qi5CXnfLjQoc2WHSO/bR0Rp0UJhpK7n PMEPUOg0amP8Dn3I9vjkr7YKywm3V6Ym0sf5Rj+B8ulwqR4WdVL2B6RINzfXoSUlRL2T ONsJhfD2rdXYBLu1R9Mm+sFjh/M5egiaUAemedOJvvppANOUdXNbuqikEhJZGSuHNCXE NvMWktdNDLJExTIlTK0SeB6CjXbcN47H62Y5HyAj5VrNLh/gyN+P0i1glTq4so8NVr1p hq3KuqZJN6ZWj6D2DUWhwddZkGNcDjnpDoBWmBzmBJHieIzI1hkmAEL/sXrhjjaZkoqo Wc5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=N9EuUopT; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cb23si14152622ejb.496.2021.03.16.13.46.34; Tue, 16 Mar 2021 13:46:57 -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=@ffwll.ch header.s=google header.b=N9EuUopT; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238139AbhCPPx0 (ORCPT + 99 others); Tue, 16 Mar 2021 11:53:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237601AbhCPPxA (ORCPT ); Tue, 16 Mar 2021 11:53:00 -0400 Received: from mail-oi1-x22d.google.com (mail-oi1-x22d.google.com [IPv6:2607:f8b0:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 776CAC061764 for ; Tue, 16 Mar 2021 08:52:56 -0700 (PDT) Received: by mail-oi1-x22d.google.com with SMTP id w125so10013879oib.13 for ; Tue, 16 Mar 2021 08:52:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=H9qbH69IBoptMfn8E8EI/JvkYdGz2fb3BHGazwe2dlM=; b=N9EuUopTyLYmp/30v4PlCksqyqVrtHnmIWXaZ4XcHcyJlh/IKbvvrNQY1qfiH3e5Ee lelk1b8VUwFdD+q76VSpMaPnzL/lvIFOuKBCKDjInKV/GcppAeygsSyrgDsECt+95gH8 4Hrr19JKU7qUT90Jqgp59LH0ykjG0DfXZI4HE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=H9qbH69IBoptMfn8E8EI/JvkYdGz2fb3BHGazwe2dlM=; b=AgfemoozAHNeVBEjKAvH9bOf6PsHecPcbfyIcblD3I18cdveoOwBzc6uDAbxFUQrV8 Zth1o2Kc5TAfapCoRh9teWhykFiKIq1IOD35d4U8F9/2grk6qpysayPhW8Hy0bfX/pgG FTDlKD1KxYKJO/w7yEPN3g11jJqG8UxGE69mGciLiJFeXD9WNreQ51SIwSfpc5kWZhnH MpvKzOCgnSh5HTu84gLvAF0sq+G0sJ2Sa5M/+Rw77TnPZC6li5o4JGMKKHJWxoSfUjzC ZCd9pSDHi0zLsbX8xx2dEZ115iA7+qwyWpWv4Ebe5Hl/j/leEA4vDspWY3qZyqHIi4Fl Dd+w== X-Gm-Message-State: AOAM533Wlx0/UJpY3P1MNC8wdmMnrmU8h6E/ME6iesgPGYEpkOmQEZKr HcNDx5m6egu/Md+nNz4zJy6ftpKQjz5fK1THf+/gUw== X-Received: by 2002:aca:4188:: with SMTP id o130mr152546oia.101.1615909975767; Tue, 16 Mar 2021 08:52:55 -0700 (PDT) MIME-Version: 1.0 References: <20210316153303.3216674-1-daniel.vetter@ffwll.ch> <20210316153303.3216674-3-daniel.vetter@ffwll.ch> <20210316154549.GA60450@infradead.org> In-Reply-To: <20210316154549.GA60450@infradead.org> From: Daniel Vetter Date: Tue, 16 Mar 2021 16:52:44 +0100 Message-ID: Subject: Re: [PATCH 2/3] media/videobuf1|2: Mark follow_pfn usage as unsafe To: Christoph Hellwig Cc: DRI Development , LKML , KVM list , Linux MM , Linux ARM , linux-samsung-soc , "open list:DMA BUFFER SHARING FRAMEWORK" , Tomasz Figa , Hans Verkuil , Daniel Vetter , Jason Gunthorpe , Kees Cook , Dan Williams , Andrew Morton , John Hubbard , "J??r??me Glisse" , Jan Kara , Pawel Osciak , Marek Szyprowski , Kyungmin Park , Laurent Dufour , Vlastimil Babka , Daniel Jordan , Michel Lespinasse Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 16, 2021 at 4:46 PM Christoph Hellwig wrote: > > On Tue, Mar 16, 2021 at 04:33:02PM +0100, Daniel Vetter wrote: > > The media model assumes that buffers are all preallocated, so that > > when a media pipeline is running we never miss a deadline because the > > buffers aren't allocated or available. > > > > This means we cannot fix the v4l follow_pfn usage through > > mmu_notifier, without breaking how this all works. The only real fix > > is to deprecate userptr support for VM_IO | VM_PFNMAP mappings and > > tell everyone to cut over to dma-buf memory sharing for zerocopy. > > > > userptr for normal memory will keep working as-is, this only affects > > the zerocopy userptr usage enabled in 50ac952d2263 ("[media] > > videobuf2-dma-sg: Support io userptr operations on io memory"). > > Maybe I'm missing something, but wasn't the conclusion last time that > this hackish early device to device copy support can just go away? My understanding is mostly, but with some objections. And I kinda don't want to let this die in a bikeshed and then not getting rid of follow_pfn as a result. There's enough people who acked this, and the full removal got some nack from Mauro iirc. Maybe if no bug report ever shows up for 1-2 years we can sunset it for real&completely. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch