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=-6.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 E05A5C433DB for ; Tue, 9 Feb 2021 00:23:21 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 41E9564E54 for ; Tue, 9 Feb 2021 00:23:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 41E9564E54 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 8137C6B0005; Mon, 8 Feb 2021 19:23:20 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7C4E26B006C; Mon, 8 Feb 2021 19:23:20 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 664DE6B006E; Mon, 8 Feb 2021 19:23:20 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0065.hostedemail.com [216.40.44.65]) by kanga.kvack.org (Postfix) with ESMTP id 50CFE6B0005 for ; Mon, 8 Feb 2021 19:23:20 -0500 (EST) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 16DD9B9F6 for ; Tue, 9 Feb 2021 00:23:20 +0000 (UTC) X-FDA: 77796830160.15.gate63_1c087d527603 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin15.hostedemail.com (Postfix) with ESMTP id DFABA18026112 for ; Tue, 9 Feb 2021 00:23:19 +0000 (UTC) X-HE-Tag: gate63_1c087d527603 X-Filterd-Recvd-Size: 4965 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf23.hostedemail.com (Postfix) with ESMTP for ; Tue, 9 Feb 2021 00:23:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612830198; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=TP6uJnqeuWbRiNKlKQkquP+smnR+VHjueUIpOLLNaCQ=; b=LV1Wa+2kQJ5K9DaiVPmeFeHRK/7NO7xQ/6A99xN/BHGzSAK7Czd8M4OmIzkkjmNvcMjBM7 tox5RwzGLhNqq7jc7RFp+ObiZ18e8s42Z8M1Zzcw0gFD5/nRFnHxKBz4okQyPREG1lo930 bYBwbtd6DBAgDYjIPybDAnIcXnQKY/Y= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-515-8R5aesRhP0OiCzYr56ge_Q-1; Mon, 08 Feb 2021 19:23:17 -0500 X-MC-Unique: 8R5aesRhP0OiCzYr56ge_Q-1 Received: by mail-qt1-f200.google.com with SMTP id d10so10954054qtx.8 for ; Mon, 08 Feb 2021 16:23:17 -0800 (PST) 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:references :mime-version:content-disposition:in-reply-to; bh=TP6uJnqeuWbRiNKlKQkquP+smnR+VHjueUIpOLLNaCQ=; b=qQTafwFGxV8Nl7nQveNZOc2XTuRIu4MDTaOMofIGq+ejThP9jhiOaDNsEa9APP0BVR MHatWxM3hpbwqE0MqGQwAm+8DqudJLJsi+Q4ct8CtzAGUJ8ALLp7tHwAeQQRDbFARt8K yBTkdGcBTA/ObZW6wd1+x5LaYhC/e1JdUzzfdypoPKFVuelNhZn2WE+FXWlPC3PLw0Px 9QqNEy3rYNR9TFZbMwcoGRxQQ7+SXcJH9Cm0GVplpgZJa9rBBF6yu+9PqLOssf3CPBuN 0Gp4LnJg33UmPdN/zf9EN37jncTUJ3O9bG7sv1Mm5AyXHZhSAru8byo3SleziqDPwC0V tU8w== X-Gm-Message-State: AOAM530+8Bq+z3TB1IuisQ6YbM3cKuZHwMPRjmY9SB8Su3lmfEtpscNG fIIpAoIAmPkRd+FerKJbubc1x3/NPjtqBlso8RlGRheA5+JbVNfCF52Y+26ug5c0JmNYfWxiq/P LnpI6eNezI8s= X-Received: by 2002:a05:620a:544:: with SMTP id o4mr21023319qko.285.1612830196952; Mon, 08 Feb 2021 16:23:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJzWNs4U+EA9v9RcX9qjKDT/ZuKzhasdvMhBjPXS/jV1Gn6jl2zjma9dO8fkqgPdHV9iV1j83A== X-Received: by 2002:a05:620a:544:: with SMTP id o4mr21023305qko.285.1612830196770; Mon, 08 Feb 2021 16:23:16 -0800 (PST) Received: from xz-x1 (bras-vprn-toroon474qw-lp130-20-174-93-89-182.dsl.bell.ca. [174.93.89.182]) by smtp.gmail.com with ESMTPSA id d71sm17505236qkc.75.2021.02.08.16.23.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Feb 2021 16:23:16 -0800 (PST) Date: Mon, 8 Feb 2021 19:23:14 -0500 From: Peter Xu To: Jason Gunthorpe Cc: dan.j.williams@intel.com, Paolo Bonzini , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-mm@kvack.org, Andrew Morton Subject: Re: [PATCH 0/2] KVM: do not assume PTE is writable after follow_pfn Message-ID: <20210209002314.GC78818@xz-x1> References: <20210205103259.42866-1-pbonzini@redhat.com> <20210205181411.GB3195@xz-x1> <20210208185133.GW4718@ziepe.ca> <20210208220259.GA71523@xz-x1> <20210208232625.GA4718@ziepe.ca> MIME-Version: 1.0 In-Reply-To: <20210208232625.GA4718@ziepe.ca> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=peterx@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline 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 Mon, Feb 08, 2021 at 07:26:25PM -0400, Jason Gunthorpe wrote: > On Mon, Feb 08, 2021 at 05:02:59PM -0500, Peter Xu wrote: > > On Mon, Feb 08, 2021 at 02:51:33PM -0400, Jason Gunthorpe wrote: > > > On Fri, Feb 05, 2021 at 01:14:11PM -0500, Peter Xu wrote: > > > > > > > But I do have a question on why dax as the only user needs to pass in the > > > > notifier to follow_pte() for initialization. > > > > > > Not sure either, why does DAX opencode something very much like > > > page_mkclean() with dax_entry_mkclean()? > > > > > > Also it looks like DAX uses the wrong notifier, it calls > > > MMU_NOTIFY_CLEAR but page_mkclean_one() uses > > > MMU_NOTIFY_PROTECTION_PAGE for the same PTE modification sequence?? > > > > > > page_mkclean() has some technique to make the notifier have the right > > > size without becoming entangled in the PTL locks.. > > > > Right. I guess it's because dax doesn't have "struct page*" on the > > back, so it > > It doesn't? I thought DAX cases did? I'm not familiar with dax at all.. but it seems so: e.g. dax_iomap_pte_fault() looks like the general fault handler for dax mappings, in which there's calls to things like vmf_insert_mixed_mkwrite() trying to install ptes with raw pfn. Or I could also be missing something very important.. Thanks, -- Peter Xu