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,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 900E4C5517A for ; Thu, 29 Oct 2020 09:38:30 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E676B207DE for ; Thu, 29 Oct 2020 09:38:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="WN/T3qoj" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E676B207DE 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 1E5D06B0062; Thu, 29 Oct 2020 05:38:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 196FD6B006C; Thu, 29 Oct 2020 05:38:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 085EB6B006E; Thu, 29 Oct 2020 05:38:29 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0239.hostedemail.com [216.40.44.239]) by kanga.kvack.org (Postfix) with ESMTP id CD9B26B0062 for ; Thu, 29 Oct 2020 05:38:28 -0400 (EDT) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 5AE8A181AEF10 for ; Thu, 29 Oct 2020 09:38:28 +0000 (UTC) X-FDA: 77424462696.04.brake58_4417dee2728c Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin04.hostedemail.com (Postfix) with ESMTP id 4201A800C8AB for ; Thu, 29 Oct 2020 09:38:28 +0000 (UTC) X-HE-Tag: brake58_4417dee2728c X-Filterd-Recvd-Size: 4658 Received: from mail-ot1-f65.google.com (mail-ot1-f65.google.com [209.85.210.65]) by imf28.hostedemail.com (Postfix) with ESMTP for ; Thu, 29 Oct 2020 09:38:27 +0000 (UTC) Received: by mail-ot1-f65.google.com with SMTP id m22so1722901ots.4 for ; Thu, 29 Oct 2020 02:38:27 -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=Egb29gKTqFSxWvJdyyI+gXsFyuWERrGbUzIe36GvMh0=; b=WN/T3qojfZLOiwWrcArWiy5sVDza4QAlNXW9uwA8epIyHde70y+LwP9IzcHYl+6ykJ TAk8UrMTzmau/HOuQondzD4ErZSwoLwV9gqj9wxMlA+Nc7EpAQq6Kw0NuRKGuGv3z2Q3 wXk6V662Zo5+uF5oqJou8URYRaL/kPvUOFj5E= 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=Egb29gKTqFSxWvJdyyI+gXsFyuWERrGbUzIe36GvMh0=; b=k9UgchzGd1bat2nCaw7EP6upd+js8bVoptaQWH2fL6exQWBuWHKhOh3VqReyepWVcs sGf1wMynXSDg2p5BHyJ05/zvd84iI/pDBFpE1+KeWU/npyC3Xi6HvOrm/tbHUwkg9zxc AZmjnhy9a0712bqKtEhHH4ABLSUuOrxQKqsScEg2Mxb94gYedl9SYMQyI0bkcfbPLfr+ 3g1jk4iU+Rg9foc1wtIkcrfrknN+5rl6z1RVUKqWG1hI/jOtU62vFHWKrlu/ItROiFQ+ FNkFkeOgC5Yih2pWz0Kw+gAgT/JaBM5I1NWwhTC4oWiRl2V4VIXSifmpDxnFm4K8+Pc2 vHSQ== X-Gm-Message-State: AOAM533FHz96wJ53anHlo529UYzinXH8v/GrEIqMPf+PrSl5gfMrrLE+ K1A0eI8++HWKNUbUFQrZ8gCe9pCjZ+WK4zGvMqk/zaqg0pCuhg== X-Google-Smtp-Source: ABdhPJx7W4rK7T8Tetk1+e1/J1/olWsPDBEjgbzX/L+3bK6RKH7lBWpMwtzMdyCSKSKNvm+bdKwtPXqJrc1sPDUR5+Q= X-Received: by 2002:a05:6830:1c3c:: with SMTP id f28mr2715883ote.188.1603964307018; Thu, 29 Oct 2020 02:38:27 -0700 (PDT) MIME-Version: 1.0 References: <20201026105818.2585306-1-daniel.vetter@ffwll.ch> <20201029085749.GB25658@infradead.org> <20201029092800.GA494@infradead.org> In-Reply-To: <20201029092800.GA494@infradead.org> From: Daniel Vetter Date: Thu, 29 Oct 2020 10:38:16 +0100 Message-ID: Subject: Re: [PATCH v4 00/15] follow_pfn and other iomap races To: Christoph Hellwig Cc: DRI Development , LKML , KVM list , Linux MM , Linux ARM , linux-samsung-soc , "open list:DMA BUFFER SHARING FRAMEWORK" , linux-s390 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 Thu, Oct 29, 2020 at 10:28 AM Christoph Hellwig wrote: > > On Thu, Oct 29, 2020 at 10:25:16AM +0100, Daniel Vetter wrote: > > On Thu, Oct 29, 2020 at 9:57 AM Christoph Hellwig wrote: > > > > > > Maybe I'm missing something, but shouldn't follow_pfn be unexported > > > at the end of the series? > > > > kvm is a legit user and modular afaict. But since you can't use this > > without an mmu_notifier anyway (or digging around in pagetable > > locking), maybe it should be EXPORT_SYMBOL_GPL now at least? > > I think it should then take the notifier as an argument even if it isn't > diretly used as a safety check, and get a new name describing it. Hm so Jason and me discussed this, but e.g. the s390 is safe with with just the pagetable locks. So we'd need two versions. The more practical problem is that I haven't found a reasonable way to check that a passed in mmu_notifier is registered against the mm we're working on, and without that check it feels a bit silly. But if you see how to do that I think we can do an EXPORT_SYMBOL_GPL follow_pfn which takes the notifier, and an __follow_pfn for s390 and similar internal code which isn't exported. > EXPORT_SYMBOL_GPL is probably ok for now, but I'm drafting a new > EXPORT_SYMBOL_FOR_MODULE() which will export symbols that can only be > used by one specific module, with kvm being a prime user due to all > the odd exports it requires that aren't really the kernel interface by > any normal means. Hm yeah that's another one. There's also some virt stuff that's currently on unsafe_follow_pfn and needs to be switched over, and I think that would also need an mmu notifier of some sorts to close the gaps. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch