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=-8.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 C0736C56201 for ; Tue, 24 Nov 2020 14:30:02 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 D55CE20674 for ; Tue, 24 Nov 2020 14:30:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="qD44Cxpt"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="M8OKVKLP" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D55CE20674 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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject: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=fmbSWbQn3YL75LA+kHlVFpXKy63XGrfPjAsnfFlo4ps=; b=qD44CxptPAdAp4mzX5QPUqajB Si49HDTdG4qBA6M3SZeWg5U7GZi27R4A8K9lo3N2SmsCoL4VaNBNQArXnozyjgDBs4jl3N65XqZuj PNTOuApLpXZENBP5T/m+4vYHJu6cF0zPe71vjJFKEHU24AgUIcZaOeur7uc3XdWR0pf15SFr2yKio cYcsS2CEDlAIhwHlr3uLOc0GNdWNi75hFHXKXtbPS+pO6Pb3TLrp0ifkUGgUaG0uV6dZhYz0R/9HB DgUrIIMNs1ad9fvXR+sclueYw214rfe1nH5nx3ghQDdNbkp1UhHrd9hJSqmKSwE6qFt9/8Q/d3A3A s9HMJMFgg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1khZJG-0000mJ-Rx; Tue, 24 Nov 2020 14:28:47 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1khZIo-0000Xu-T7 for linux-arm-kernel@lists.infradead.org; Tue, 24 Nov 2020 14:28:20 +0000 Received: by mail-wr1-x443.google.com with SMTP id 23so22490433wrc.8 for ; Tue, 24 Nov 2020 06:28:18 -0800 (PST) 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=KSq6GECp1i25ezV0Y6T/3NvT3N3r3AJ5cEVxbDW0CLw=; b=M8OKVKLPb+FMINuPALRG9V3PVI91CXQvXh6el7xGRjUkVyzBaQH4KHu/tMBmJ5taDe 59iDiQDNm2o3xbPwv0oSLio8yFOJvro7J42g63pWYI73IIHBT3JzdvD1M0d8OksY+kMI XGPBgQVF+ghp0Mqq2KbUaYPWwm0MKVO12MAPQ= 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=KSq6GECp1i25ezV0Y6T/3NvT3N3r3AJ5cEVxbDW0CLw=; b=fVxQXghJyFhqNEyQbyyMf6vbY2tgOFM6oAd/D+uyu7cwkV8Nlfl9e72x8/+SbYuqrY VTOXT+O4ZZGDiiOVD929lGMsXF17oNLmOJwqca/taMG3RF/hxpp356WZ+9fSGKJa3h/I s3BMjijhrkpU0FdowbK0kRPM/b0XIa/GRpNWN+FD+Vj3X/mjJuJlwTgmTuDM2yB6WEMn nsS4j6OHAig4cRKccShi5asMKhGoRtFMCotzsr1HAhZA57lXDvb/8cr/Ydj/QOuLh5Ju MKoHVo2pFHe89LyIIeQu2+ie6K2RPHlVt6T7oNO0CLi31W4ol5KAzE4sCPO0j8958jNu uWjg== X-Gm-Message-State: AOAM532x0Dd10w+TVjJroQsUcMCaV59gvTy03UPAGnmuxwtXvFNOkFuI D2MwttyaaoJ0pkczspzQwnId2A== X-Google-Smtp-Source: ABdhPJzYIyfiFO7Qic0f+2tVMFNssr9Nw0LvMxY+vwY4ywKdlugcFp6ONKZKvUGFaWMjY1vmdCWa+w== X-Received: by 2002:a5d:610d:: with SMTP id v13mr5595456wrt.425.1606228097589; Tue, 24 Nov 2020 06:28:17 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id 35sm27158318wro.71.2020.11.24.06.28.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Nov 2020 06:28:16 -0800 (PST) Date: Tue, 24 Nov 2020 15:28:14 +0100 From: Daniel Vetter To: Jason Gunthorpe Subject: Re: [PATCH v6 17/17] RFC: mm: add mmu_notifier argument to follow_pfn Message-ID: <20201124142814.GM401619@phenom.ffwll.local> 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, Daniel Vetter , Christoph Hellwig , Kees Cook , Dan Williams , Andrew Morton , John Hubbard , =?iso-8859-1?B?Suly9G1l?= Glisse , Jan Kara References: <20201119144146.1045202-1-daniel.vetter@ffwll.ch> <20201119144146.1045202-18-daniel.vetter@ffwll.ch> <20201120183029.GQ244516@ziepe.ca> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201120183029.GQ244516@ziepe.ca> 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-20201124_092819_134080_65CDFC08 X-CRM114-Status: GOOD ( 20.72 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-samsung-soc@vger.kernel.org, Jan Kara , Kees Cook , kvm@vger.kernel.org, Daniel Vetter , LKML , DRI Development , Christoph Hellwig , linux-mm@kvack.org, =?iso-8859-1?B?Suly9G1l?= Glisse , John Hubbard , Daniel Vetter , Dan Williams , Andrew Morton , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org 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 Fri, Nov 20, 2020 at 02:30:29PM -0400, Jason Gunthorpe wrote: > On Thu, Nov 19, 2020 at 03:41:46PM +0100, Daniel Vetter wrote: > > @@ -4805,21 +4824,15 @@ EXPORT_SYMBOL(follow_pte_pmd); > > * Return: zero and the pfn at @pfn on success, -ve otherwise. > > */ > > int follow_pfn(struct vm_area_struct *vma, unsigned long address, > > - unsigned long *pfn) > > + unsigned long *pfn, struct mmu_notifier *subscription) > > { > > - int ret = -EINVAL; > > - spinlock_t *ptl; > > - pte_t *ptep; > > + if (WARN_ON(!subscription->mm)) > > + return -EINVAL; > > > > + if (WARN_ON(subscription->mm != vma->vm_mm)) > > + return -EINVAL; > > These two things are redundant right? vma->vm_mm != NULL? Yup, will remove. > BTW, why do we even have this for nommu? If the only caller is kvm, > can you even compile kvm on nommu?? Kinda makes sense, but I have no idea how to make sure with compile testing this is really the case. And I didn't see any hard evidence in Kconfig or Makefile that mmu notifiers requires CONFIG_MMU. So not sure what to do here. Should I just remove the nommu version of follow_pfn and see what happens? We can't remove it earlier since it's still used by other subsystems. -Daniel -- 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