Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp289063pxx; Thu, 29 Oct 2020 02:40:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9pGD0fEaZ4uyfRG3QkVRGLBcsDBio4JnMgVbkRazTaulUFQXmXTH5y0XSgHiGVKju9duk X-Received: by 2002:a17:907:204c:: with SMTP id pg12mr3014211ejb.464.1603964422685; Thu, 29 Oct 2020 02:40:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603964422; cv=none; d=google.com; s=arc-20160816; b=Dmr+/Z9put6HmJwP4975lx37jNWgXfzyhEH4XY30nGPOB37bD6/9fW6Wy3AVG0Q9r4 GJoMXH1f291ke//vyrGbaj/abjQL3vHB5fZwi83rn72D6s/591oCRwOdQr/LAQYcCc08 v1ti+J/Q7aVnjq0EdEkmCcG0INp1T31v1HZdIWkGRPjQIbwAAaA9UwKbJYvgxKtCi3iy MW0XZ45A4whj/k2mwfc7HnYt91gV0LcNvAl5FjQUj+gMNHUxr5UJA0BraowCD84kfxpl dfIdYeZxsJmA0eNA5vsbiNrqu3QF0AWNpDGG9KPtKMjv6hqOT0yU3Yq319Rjwj5keBcF 4Fjg== 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=Egb29gKTqFSxWvJdyyI+gXsFyuWERrGbUzIe36GvMh0=; b=L8iO41xYn/ktESzggML08mvmcMujGIdZjZgBpiP5/39f4DyPQyYSWNF1czqiKtuxTW DjlRpInLMJs3DfMM/4YfBBCdsh8Slr6dlvFEDunkTlC5jWHiUf4EruLnbs+lbcr0VSKF j7v+G4b+17/rNkvUMuk/Usj3i7b7S/+OYi29YGtS95I4WX2NO3oba8wYXpAwGKsbu4U/ uMjFeo6XqkOtgWaw5UY6GHvV4Zcw5za4OmZHEgfSp0prmZHrgI3vh6/cUbzPiIrSFE9D sRmFUxjeW9mfNd39K9RE5Wzj/JmG+wccoM6G5b9ftU4aW4wnMs8gMVtz4vw0q7M2NeKi vRTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b="WN/T3qoj"; 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 s18si1293633ejd.147.2020.10.29.02.39.58; Thu, 29 Oct 2020 02:40:22 -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="WN/T3qoj"; 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 S1726220AbgJ2Jia (ORCPT + 99 others); Thu, 29 Oct 2020 05:38:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726018AbgJ2Ji3 (ORCPT ); Thu, 29 Oct 2020 05:38:29 -0400 Received: from mail-ot1-x342.google.com (mail-ot1-x342.google.com [IPv6:2607:f8b0:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE04AC0613D2 for ; Thu, 29 Oct 2020 02:38:27 -0700 (PDT) Received: by mail-ot1-x342.google.com with SMTP id a6so1683281otp.10 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=sVyoXxCsuCcntcOSbNcEU+awXqjTH00++LDY7bR5S5q5NTKakvj5BjfWfQaiC1iZHO 95VLcUxNsjO46NiE2NI2hdJtO4bZYyQ/2FVFuvM+MGKsocj7156hO4EDYpHtiRTY+uJI 4IUhbUXaJ9xlmNV4tC+hGsX7ALseHbDa1j9WkwKbCUSq0PLj7wCdT8H6iyB+wkCcubtI F07a0XNgiPlj8hvKg/YrUEyEeEwrW0X0JdnkeYsCFFhsCfdtwad7IpBZP0xY8SJE60SO tGXTS03+gDNHP6/rsrQoVlW/PyKZKBPsA15kKfT7PBSo5yvLYb1+dh9kWEEsRrf76ahB CTGg== X-Gm-Message-State: AOAM530SlLToOIRd4ltB4ZhCA05SV1S3e3qd/65PRlMZKNYWw3fzXaGG wgcWapD8bpTJXOvLtYsTTGXY4TQMNxKMQlUEhtI8Dg== 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" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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