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=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 E65B8C56201 for ; Wed, 25 Nov 2020 09:01:42 +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 4397A206F9 for ; Wed, 25 Nov 2020 09:01:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="KVSis8KP"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="JkicOjiQ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4397A206F9 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:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=dR/ehbszaUQePXmn3XkVe0EzLB8kPUI1Vq/zR08PdVM=; b=KVSis8KPhsCZbSINFN9wHVpI4 ULwnBeQXjV1ylXvRkXuifNcpRRNuSLtRJ3JkBxO6uvN/1aOV8eFM8ua2bx4bx8sBQuofeSvbZFYLX Q43y9N2BhPsW/p4eVrUALjnOJbCUTrwpDJStdG5b/ywBF52ItIRR0gYSn+FtAJ3wZ+dgDWwdX+G97 SoBP9Mv98CFyX6I812bkg58peFZ7tclKXLNUPcSzVexIDn7W5kBZYV5ePfD3tsb1x0PvQ8M//ZpZd +wnuFCZxRcIcwYZRb9Wf9lIWZN3qqsmi0q731s1VHxktU+gNTqzUlndVm3lTacZQcGyN37+ri5/8o Km02pU+KQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1khqfd-0006qK-UB; Wed, 25 Nov 2020 09:01:01 +0000 Received: from mail-ot1-x32a.google.com ([2607:f8b0:4864:20::32a]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1khqfb-0006oF-Hm for linux-arm-kernel@lists.infradead.org; Wed, 25 Nov 2020 09:01:00 +0000 Received: by mail-ot1-x32a.google.com with SMTP id l36so1588770ota.4 for ; Wed, 25 Nov 2020 01:00:55 -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=cb0IyYfwRRpwkSMXLoK5meWkqSB6m3aHpp32lgtuG5E=; b=JkicOjiQYuUe4qC0NCYmxG5Jf2Qdd6VpUQG0aEBdA3L/hZkGUrza6gxYa2hMmPMY/s ewVWRJYqWnQURjTZ+yFTAdl1Ez4sxo1/0FaXREz0psNNjo/Ewp3/C0rJLjM2dFGW9gyu BSTEd4SBqAlo0o+/0PsIWfkx3MMZ6g5rTd+P4= 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=cb0IyYfwRRpwkSMXLoK5meWkqSB6m3aHpp32lgtuG5E=; b=BzHdMBjg6Zll9ADFYasQMnHebfx/LwyE+Q7Pnhyo+EM+b8yb1uthOmwDULdXyVzHew +PgRe2frxE5wh+f+DHOUgbSHWaWJHvidxA7uuAPGo/pGfH2guZ0U/JATLKX7bvcLNVNj srGRrU4j8tkyvFlE6Dfggudeeg7aBKYlygnhpICK+1fP7mq3wGm3d7dEyRbMtBInbU12 6oaz1+/UTy5732IK2AbJvYN3Pnq3W18eh5eh0s89nL4h08DW8LrrsDlDW7cW9V9Ln4C0 1/00O/kI7+2eV1YMxp+jD1RG9GF6aAywmIgyiAQjNc+DQkphwD3AcrxPBdrul6iBEQeO RFOw== X-Gm-Message-State: AOAM530+4jpCeLqQPLqUoS9dY/olhTF78P4LWg/ETeTEgnDZEENdTgW1 HsFgc0i8nmNtHO21hEe8m0WhUM8G1Dl618oRtjEUjMXMyXY= X-Google-Smtp-Source: ABdhPJzdLrBChJNmwAufHSFyRkbYFLtVRK1HD1rbwhJfrbBBuHxsolU3fINxVDwgeq07RNzsEDacWevGKQb60NxLVLQ= X-Received: by 2002:a05:6830:3155:: with SMTP id c21mr2109430ots.281.1606294853508; Wed, 25 Nov 2020 01:00:53 -0800 (PST) MIME-Version: 1.0 References: <20201119144146.1045202-1-daniel.vetter@ffwll.ch> <20201119144146.1045202-18-daniel.vetter@ffwll.ch> <20201120183029.GQ244516@ziepe.ca> <20201124142814.GM401619@phenom.ffwll.local> <20201124155526.GH5487@ziepe.ca> In-Reply-To: <20201124155526.GH5487@ziepe.ca> From: Daniel Vetter Date: Wed, 25 Nov 2020 10:00:42 +0100 Message-ID: Subject: Re: [PATCH v6 17/17] RFC: mm: add mmu_notifier argument to follow_pfn To: Jason Gunthorpe X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201125_040059_601509_5AC982C8 X-CRM114-Status: GOOD ( 28.83 ) 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 , Jan Kara , Kees Cook , KVM list , John Hubbard , LKML , DRI Development , Christoph Hellwig , Linux MM , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Daniel Vetter , Dan Williams , Andrew Morton , Linux ARM , "open list:DMA BUFFER SHARING FRAMEWORK" 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, Nov 25, 2020 at 9:13 AM Jason Gunthorpe wrote: > > On Tue, Nov 24, 2020 at 03:28:14PM +0100, Daniel Vetter wrote: > > 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. > > It looks like only some arches have selectable CONFIG_MMU: arm, > m68k, microblaze, riscv, sh > > If we look at arches that work with HAVE_KVM, I only see: arm64, mips, > powerpc, s390, x86 > > So my conclusion is there is no intersection between !MMU and HAVE_KVM? > > > 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. > > This is what I was thinking might work Makes sense, I'll do that for the next round. -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