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=-5.8 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,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 9A89BC433E0 for ; Tue, 16 Mar 2021 15:53:08 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id EF37C650F4 for ; Tue, 16 Mar 2021 15:53:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EF37C650F4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 783886B0083; Tue, 16 Mar 2021 11:53:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 75A816B0089; Tue, 16 Mar 2021 11:53:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5FBC56B008A; Tue, 16 Mar 2021 11:53:07 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0129.hostedemail.com [216.40.44.129]) by kanga.kvack.org (Postfix) with ESMTP id 438CC6B0083 for ; Tue, 16 Mar 2021 11:53:07 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 0112A181AF5F4 for ; Tue, 16 Mar 2021 15:53:06 +0000 (UTC) X-FDA: 77926181214.28.DD5A98F Received: from mail-oi1-f169.google.com (mail-oi1-f169.google.com [209.85.167.169]) by imf04.hostedemail.com (Postfix) with ESMTP id B4B902BE4 for ; Tue, 16 Mar 2021 15:53:02 +0000 (UTC) Received: by mail-oi1-f169.google.com with SMTP id w65so38569825oie.7 for ; Tue, 16 Mar 2021 08:53:02 -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=pwagO1G9NDQ9EbYTng5pVuJ9cJJoFPIiJ1tbNYekcTJ1RARQjaqgM2cMf/HB4RmdKH E18Ag99ZhoDwIkx5odW6Er8LoG+Y1XG34H5XcEBisnrMsS+GpaYmqnh8qrOhCluCqv7i qMP7K7VQu4/c8kkJ3y6W4s7sEVfvPTPwbWCmrfan+kkg+MXxAxM4+x/8ykb6OMbvFnDg hSs30mjreD4Q0txXRXTfktYP7OOweUYYgGaD3h43Dvy6+CM9ifPYcpjxT1sEWatAYKL9 4x9glYMQbLAhS6MSxKKoLYuO5gSnuSFm9hoEqKmALZBNSISSkQ3RFWmg5FMc3e3uuWLz Crrg== X-Gm-Message-State: AOAM533JPXAIx06APVLLyqpXefGFYh1KuPuf2k5O83Jv2dSge7TCOg3Y Kw5CNrtzfER8ULk0A933503UIQmCeu9nHJ07EbGZow== X-Google-Smtp-Source: ABdhPJznz2I6yaUfu5sapSxfaawTvDWTc4egwzJFTFOwI97d2Oq+qgjhGAyeojv1m2fr5BiGgMr/zgmA3/HTfQyhJ8k= 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" X-Stat-Signature: x545turfy4frgh5e1o1wg6sb84xo4pz5 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: B4B902BE4 Received-SPF: none (ffwll.ch>: No applicable sender policy available) receiver=imf04; identity=mailfrom; envelope-from=""; helo=mail-oi1-f169.google.com; client-ip=209.85.167.169 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1615909982-652871 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 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