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=-14.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 70230C433DB for ; Wed, 24 Mar 2021 19:18:58 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E1C7161A07 for ; Wed, 24 Mar 2021 19:18:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E1C7161A07 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=DOzPcKuBv9m4qO0jJvhp5Exli2pnU9YQitKyHjNOtZg=; b=OfkQRL0FmKf/1B1NdCLLLHDbh +f+ExH+g2lGboPHe7dAr+h/YyQGd8FYgChpw/dFD1pOxD2y122EG4M07GQsk4HeUZpkUgLl3jlwea 2X56Mbkipft6ctkCK9rYKjW2SCiIijN22QPx13GMg+0mPFFOwKxQysZPVduJKM65aR3XB3i8VB6GY myhLeJsw4J2DXpAxVmfSRPVRaBBu6S8x11fiEawB++cROJtgfPR4YVSLaHqZY1AAnCHiyiuyk/UKp QnWVqjsW8kQbCnJhuhUPOifpUlU6EiPTLx9MBtrQs2BsY9KdZ3/kH/de/xNQd+O3YU3SEV4/H63V9 gIoIzguZQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lP90K-0007m7-Gi; Wed, 24 Mar 2021 19:17:20 +0000 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lP90E-0007lR-L9 for linux-arm-kernel@lists.infradead.org; Wed, 24 Mar 2021 19:17:17 +0000 Received: by mail-wr1-x42c.google.com with SMTP id x13so25565299wrs.9 for ; Wed, 24 Mar 2021 12:17:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=ks7ShY2KdqBCOa2qudGrTxafbstGO1KxoD94z5nmwd4=; b=bjZoBOViVyL1mHLmUFR7BSZIMAluKI/kXY5E2/ztjZRSCxzbzqraymTeP/LQuXxMd6 5YPx58H1VAuhSW12/DzOC9BHGHgBV1J/hhCob2AhjQhBoGcMDaLPjYwGaOGrtjITgpiU twnR7Di8AA6EdQ4WpfeSjtyjUfsAP9baelo+A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=ks7ShY2KdqBCOa2qudGrTxafbstGO1KxoD94z5nmwd4=; b=gMkM6X3E6mQ+gfAmTBiUXntK2FXLUQABP4MxL57TBuCfeO9Z8t6mjE/w24/ryx2mFj zszVR3r0eEfQgssFR7WUW1tsDQ09tG2THnrml0+JBZOzoRiwcKaK4fMkPKMQ1A+K1yAW 8cYz3pifuI6cKgcapEdg8OEcOX+8m4QIHoyH9lpXggxgN2JoKsP9HuZS2X6nZNW2WIpP Qe6OqX/CJhbxof8wid+hcJpF47PdGI7ifAz/JASfKaEpg/WRzAJOFIu7xGx4Z6NXSyXw rUGbV892H6boVExv1HRm3cx1M/mp4Z3fL96VdNWBYCTO0NwRkdQHuDEO2jaRdPlRChGG mrsQ== X-Gm-Message-State: AOAM531JS9DNBbywNES/WcovQ3vMFnBDQ0FNL9oB4ts7Dw7GjmvJbV6G yCEesNsFETwNvucVimRd6vy2Jg== X-Google-Smtp-Source: ABdhPJz0jKYo0H/XBwWmbtO5rMA4MuyiBVo+Vi9lmrQcQ8si+ZT3Tkgf1DTxMp2/fnyfyvXSPQ76vg== X-Received: by 2002:a5d:6312:: with SMTP id i18mr5156957wru.149.1616613433126; Wed, 24 Mar 2021 12:17:13 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id f2sm3344574wmp.20.2021.03.24.12.17.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Mar 2021 12:17:12 -0700 (PDT) Date: Wed, 24 Mar 2021 20:17:10 +0100 From: Daniel Vetter To: Jason Gunthorpe Cc: Daniel Vetter , DRI Development , LKML , kvm@vger.kernel.org, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-media@vger.kernel.org, 3pvd@google.com, Jann Horn , Paolo Bonzini , Cornelia Huck , Peter Xu , Alex Williamson , Daniel Vetter Subject: Re: [PATCH 3/3] mm: unexport follow_pfn Message-ID: Mail-Followup-To: Jason Gunthorpe , DRI Development , LKML , kvm@vger.kernel.org, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-media@vger.kernel.org, 3pvd@google.com, Jann Horn , Paolo Bonzini , Cornelia Huck , Peter Xu , Alex Williamson , Daniel Vetter References: <20210316153303.3216674-1-daniel.vetter@ffwll.ch> <20210316153303.3216674-4-daniel.vetter@ffwll.ch> <20210324125211.GA2356281@nvidia.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210324125211.GA2356281@nvidia.com> X-Operating-System: Linux phenom 5.7.0-1-amd64 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210324_191714_900187_67659B73 X-CRM114-Status: GOOD ( 28.80 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Mar 24, 2021 at 09:52:11AM -0300, Jason Gunthorpe wrote: > On Tue, Mar 16, 2021 at 04:33:03PM +0100, Daniel Vetter wrote: > > Both kvm (in bd2fae8da794 ("KVM: do not assume PTE is writable after > > follow_pfn")) and vfio (in 07956b6269d3 ("vfio/type1: Use > > follow_pte()")) have lost their callsites of follow_pfn(). All the > > other ones have been switched over to unsafe_follow_pfn because they > > cannot be fixed without breaking userspace api. > > > > Argueably the vfio code is still racy, but that's kinda a bigger > > picture. But since it does leak the pte beyond where it drops the pt > > lock, without anything else like an mmu notifier guaranteeing > > coherence, the problem is at least clearly visible in the vfio code. > > So good enough with me. > > > > I've decided to keep the explanation that after dropping the pt lock > > you must have an mmu notifier if you keep using the pte somehow by > > adjusting it and moving it into the kerneldoc for the new follow_pte() > > function. > > > > Cc: 3pvd@google.com > > Cc: Jann Horn > > Cc: Paolo Bonzini > > Cc: Jason Gunthorpe > > Cc: Cornelia Huck > > Cc: Peter Xu > > Cc: Alex Williamson > > Cc: linux-mm@kvack.org > > Cc: linux-arm-kernel@lists.infradead.org > > Cc: linux-samsung-soc@vger.kernel.org > > Cc: linux-media@vger.kernel.org > > Cc: kvm@vger.kernel.org > > Signed-off-by: Daniel Vetter > > --- > > include/linux/mm.h | 2 -- > > mm/memory.c | 26 +++++--------------------- > > mm/nommu.c | 13 +------------ > > 3 files changed, 6 insertions(+), 35 deletions(-) > > I think this is the right thing to do. Was just about to smash this into the topic branch for testing in linux-next. Feel like an ack on the series, or at least the two mm patches? -Daniel > > Alex is working on fixing VFIO and while kvm is still racy using > follow pte, I think they are working on it too? > > Jason -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel