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,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 CAE72C55178 for ; Mon, 2 Nov 2020 12:56:25 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 373CF22273 for ; Mon, 2 Nov 2020 12:56:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="T3p+MSLR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 373CF22273 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 7CD246B0068; Mon, 2 Nov 2020 07:56:24 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 77D226B006C; Mon, 2 Nov 2020 07:56:24 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 66B336B006E; Mon, 2 Nov 2020 07:56:24 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0254.hostedemail.com [216.40.44.254]) by kanga.kvack.org (Postfix) with ESMTP id 37A0F6B0068 for ; Mon, 2 Nov 2020 07:56:24 -0500 (EST) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id D916F180AD811 for ; Mon, 2 Nov 2020 12:56:23 +0000 (UTC) X-FDA: 77439476646.03.rub08_5017d92272b0 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin03.hostedemail.com (Postfix) with ESMTP id B614228A4E9 for ; Mon, 2 Nov 2020 12:56:23 +0000 (UTC) X-HE-Tag: rub08_5017d92272b0 X-Filterd-Recvd-Size: 3879 Received: from mail-ot1-f65.google.com (mail-ot1-f65.google.com [209.85.210.65]) by imf25.hostedemail.com (Postfix) with ESMTP for ; Mon, 2 Nov 2020 12:56:22 +0000 (UTC) Received: by mail-ot1-f65.google.com with SMTP id l36so4471974ota.4 for ; Mon, 02 Nov 2020 04:56:22 -0800 (PST) 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=U5ses3L4S0EGFIO147NO/jaN4EloOqduj8AeaQfFuV8=; b=T3p+MSLRVTQeTCxHlv2KtbWAgQXYXjF/NQ5vZEZ56cGWMPWmhzeFc9ZhAf24TyMNJy X8ZVYO+h7DmQjzrCGnwO7PCiNeRaaOGSFYoXqqakqdoymjMzjnu9kMLe6DLLbyq0pqc5 IQ0xty7dRJBPKhniovuUncjzErvz8QtDqXg1c= 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=U5ses3L4S0EGFIO147NO/jaN4EloOqduj8AeaQfFuV8=; b=c+vDGV0PLMb+3++6SWgUMyUbMdzxQtsHINXGyV5XECoGh6VIm5511cW+yp2/8kqYOh AVSM+0jc+PlCHIbOepW68YNpdT5DnS40FJvSPc9jcQ0z9rp9TuPioBWdsaEeUUwfdAI5 cU3fysY/451AD6rcGRnL0w6uhqehsok//RxhsnLmdeCXKrHKPAi5K7/OIDvKjDA5fKCt 4AtLsbS/x4hTwkeXOQHPfw7mT1+DIoSv/Zp1wbbV6qPz0j2AlU0MMl15nokzovNITLKy 84pFHgUVfsofbJRS8TtsUAttiqLOqUF9q6MmH0QBkwF1O9vpQSlTeD1CzqBI+sjAsSFD zoyg== X-Gm-Message-State: AOAM533enyWpsq9UkjHqgwOi0En7Zc595GFf7kcUipLWBD1EGpEOJ3uE 4Hk78EWG3dVLFPPFpHy3CQqjYReCzzQjzJBU2dZTzQ== X-Google-Smtp-Source: ABdhPJxuikM8EweOBXPqOBWXx8bGKhMyIqIExlZHbYHppkEx5/UodSudDdaWfAmFL8eR0NFLmbTm21/CfypVpUHeCk4= X-Received: by 2002:a05:6830:1647:: with SMTP id h7mr12585840otr.281.1604321781980; Mon, 02 Nov 2020 04:56:21 -0800 (PST) MIME-Version: 1.0 References: <20201030100815.2269-1-daniel.vetter@ffwll.ch> <20201030100815.2269-9-daniel.vetter@ffwll.ch> <20201102072931.GA16419@infradead.org> In-Reply-To: <20201102072931.GA16419@infradead.org> From: Daniel Vetter Date: Mon, 2 Nov 2020 13:56:10 +0100 Message-ID: Subject: Re: [PATCH v5 08/15] mm: Add unsafe_follow_pfn To: Christoph Hellwig Cc: DRI Development , LKML , KVM list , Linux MM , Linux ARM , linux-samsung-soc , "open list:DMA BUFFER SHARING FRAMEWORK" , Daniel Vetter , Jason Gunthorpe , Kees Cook , Dan Williams , Andrew Morton , John Hubbard , "J??r??me Glisse" , Jan Kara Content-Type: text/plain; charset="UTF-8" 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 Mon, Nov 2, 2020 at 8:29 AM Christoph Hellwig wrote: > > On Fri, Oct 30, 2020 at 11:08:08AM +0100, Daniel Vetter wrote: > > Also mark up follow_pfn as EXPORT_SYMBOL_GPL. The only safe way to use > > that by drivers/modules is together with an mmu_notifier, and that's > > all _GPL stuff. > > I also think it also needs to be renamed to explicitly break any existing > users out of tree or int the submission queue. Ok I looked at the mmu notifier locking again and noticed that mm->subscriptions has its own spinlock. Since there usually shouldn't be a huge pile of these I think it's feasible to check for the mmu notifier in follow_pfn. And that would stuff this gap for good. I'll throw that on top as a final patch and see what people think. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch