Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp61246pxb; Tue, 12 Jan 2021 20:08:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJx9SXuUf87lckFeqaZA2XbO2cyjPJwaN90lhpFGghW6WxBuh70fwo+cX7dsN0OWj1y48efs X-Received: by 2002:a17:906:b0d2:: with SMTP id bk18mr145956ejb.508.1610510897242; Tue, 12 Jan 2021 20:08:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610510897; cv=none; d=google.com; s=arc-20160816; b=KBq0is8tGV/WQI9wPW4yGg4P8rpSiLACpVFpJCX2pnQPe5gQsPSqFbRC+xzhcsFP07 fEpdW07pjF8/f1nXfD1+JoTsEpj5K5ifht6bYto/ze3lmUDSr1vabeYhLaxZkrlCybXb EOsK7kZxQ49rFYQpOQ9A4zizj6K8kROv/u2lbw7qG5f4RrPwWP8iZkIYRSleF0R2deEK u241dCVIEaqcpAzdG9MzkWJDP7Pm/wQxDt48MaGRJD9MZJcdspszDnl+qBuH1VwfWSpl ZPLZ8Q+q6N2FKSYJ4UTjL8N6V6jCqOYZe0mj7+i18VNRcK9IIJI90hPn1fh4I0u2vlpR Rc3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=g4tM896pbQJI+Gp8mwNX2aPgPi6cdbs1iXu2Rh7XoAs=; b=HHvL9ZhwnufZVc9eUC1SChSsHkClUgUjTWliRMFJbJLioPrGBgCu7nGM6L4WfkkcMj caz3M2VzVM4jmtwkZriQSl+A3/QZkHH+CW4jW1NqaB4hqOl9bJ+VBIn2iOnnJmSVWu6N 7E/0KeutahaH9K17+7AdM10p1tes+fkD0EL0Bfg0RpMk1C7x4fDixr9qEdbKfIZNktgu p175+C6q0afc8T0VpyxyGXPm/7aD6Vpq6zu9EXnb3A6RKu0gL/mFLJlYKcrDf2EhncTt YQcGB79jrIC/omYQI87hPr0MXlXInlUiQiFYqzpsK7/qnReiTsrufdyQGAHjFhYKNS4d wqSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=icrdld4c; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v1si458199edf.22.2021.01.12.20.07.53; Tue, 12 Jan 2021 20:08:17 -0800 (PST) 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=@kernel.org header.s=k20201202 header.b=icrdld4c; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731658AbhALVss (ORCPT + 99 others); Tue, 12 Jan 2021 16:48:48 -0500 Received: from mail.kernel.org ([198.145.29.99]:44732 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727673AbhALVsq (ORCPT ); Tue, 12 Jan 2021 16:48:46 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1DBF42313C; Tue, 12 Jan 2021 21:48:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1610488085; bh=xEYKassPQC4sKkuJ/2fsneFhalU4oSuuI5/rscjtbAE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=icrdld4c54puBOpoMHt9NPZtfqeCBNMviZxMC5FDARPEr9/3jX8GtCDAHsbVBHpxu NB0eNSp/vmkU8PDKa4tkMDYjcVKZ1NybKKK9bfIEwIJIiS2za7N9YaVVSmYDrDDlKl Yois18ZHdKDcmOpujXX4l9WUOxmdNbrBKSD6TfGqSV1mPuvHMkcTINIjtHNqoONxyM zuzGwkrXpGMDjaJBy0XEDfW1GDs79rD4pH7Ygps03ur03fsPjSDRytFmzWpewqdLfc LPbbVt2UQuN3vyhC2nzEH5hQ++y4Eq05d5Ct6komeN41vBqMsNO5W/unjq7rLSzA5W o7W9L+GLIS6VQ== Date: Tue, 12 Jan 2021 21:47:59 +0000 From: Will Deacon To: Linus Torvalds Cc: "Kirill A. Shutemov" , Linux Kernel Mailing List , Linux-MM , Linux ARM , Catalin Marinas , Jan Kara , Minchan Kim , Andrew Morton , "Kirill A . Shutemov" , Vinayak Menon , Hugh Dickins , Android Kernel Team Subject: Re: [PATCH v2 0/3] Create 'old' ptes for faultaround mappings on arm64 with hardware access flag Message-ID: <20210112214759.GC10434@willie-the-truck> References: <20210108171517.5290-1-will@kernel.org> <20210111142402.6euyktmcnpemanf7@box> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 11, 2021 at 11:25:37AM -0800, Linus Torvalds wrote: > On Mon, Jan 11, 2021 at 6:24 AM Kirill A. Shutemov wrote: > > > > I wonder if it would be acceptable to pass down to faultaround a copy > > of vmf, so it mess with it without risking to corrupt the original one? > > I'd almost prefer to split vmf into two parts: the 'this is the fault > info' part and the 'this is the fault handling state' part. > > So the first one would be filled in by the actual page faulter (or > GUP) - and then be 'const' during the lookup, while the second one > would be set up by handle_mm_fault() and would contain that "this is > the current state of my fault state machine" and contain things like > that ->pte thing. > > And then if somebody actually needs to pass in "modified fault state" > (ie that whole "I'm doing fault-around, so I'll use multiple > addresses") they'd never modify the address in the fault info, they'd > just pass the address as an explicit argument (like most cases already > do - the "change addr or flags in vmf" is actually already _fairly_ > rare). Alright then, I'll take another crack at this for v3 and see how far I get. Will