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=-4.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 08341C433DB for ; Mon, 11 Jan 2021 19:27:41 +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 8E2EE22CAD for ; Mon, 11 Jan 2021 19:27:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8E2EE22CAD Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org 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=clz2xrEz30fYBi4BBKb5rz/7mfyuLJjsksT/evVQRWI=; b=TXt6StW3HW0WGe41UuQGORa4O 9biW8xeQRDaXqMH6nhxbHamQ5MdTYyLMLrWAz9ZEO564u6KdAEUS23cBH5eto0zODjM3SpVNvOvNy +jnXIDMb8nHnYL56GeVg6US84rWGRReYCK9P87kGgdfuOjVRbpk/rj2vuwhEyPWo7VcyCy2f3L6/a Pf0oX2Yjl2ePupwZFZe3Npt7QNIEur9MM7ASE82fuQSxjZl6tQE5spqRZNdsvh5JwHugIneye+evU j0SUHEeFEQTteALwORRYLKg+Wd8D+kU7JFLtN0Csnldu6jipeWmeDOSx/kbS6S8sIX5uwllSlX2SC M9h62F/DA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kz2pI-0000eZ-Ba; Mon, 11 Jan 2021 19:26:04 +0000 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kz2pC-0000cg-Ml for linux-arm-kernel@lists.infradead.org; Mon, 11 Jan 2021 19:25:59 +0000 Received: by mail-lf1-x133.google.com with SMTP id o13so1230656lfr.3 for ; Mon, 11 Jan 2021 11:25:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=oKNFHHPFfD7wrwfuT7r81/lh6WrZWqpMnLmKMYRybYs=; b=T4dW7LSW7T2wg9bacwMkeXXtLd4Ok0sO57tNlnjcAH8Ux7LmYSjZ0lozL/qlAFcVMW /X7YR78gi7Ax/0lk70yZx3V9MQaMI7jS/gAfWwdp4tXVRSg+DjhZ8vv5aWsRaxJuwJRC ABafPi7lpmnzPtXbWxsMbYU5IEhVTnlyC3SEM= 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=oKNFHHPFfD7wrwfuT7r81/lh6WrZWqpMnLmKMYRybYs=; b=KI2eVetJGAGiD/8/C8ABzhFxNarLDrkJguU7Fz3Z6zstYWX5pUeRqyL6Sp6OBQeMDl Muml/PUR9CBSkstdhypmWlEh5PlYUzOU8O4FtWSUTW6xkXKK9jk8QWynDYuv/CNa0RD2 QFIA4nKkeOdTABYAvooF4UodJ5pAKuGF+vn83t5CP/IhSb/59a4BORD2AY3bgTBKblsB tVP3G9Pk47+vHHrb5Z7bxjfr4O8XlO+G6T7WdSDHaAeENOYyMJwQrspV50tHrBBaWK1g ttlULi4yS9ovtvbEK1ADbTQ3adC5mP3Z5lEbQsFA6y8eesrj2mIWTGpzNVT88Q8t5Ai8 qNog== X-Gm-Message-State: AOAM532U/1F4uxRC7zF8X+znyiZ2In0Hq2R6Nx1EHko24+7lBJA9awVy iZTLdtOiXYxLJFpahZtiy7S01omn9NIRfg== X-Google-Smtp-Source: ABdhPJy8RaOWbqgqW6hnrCpgFpuDXtw7isoVhnW9tiFzY+P12qonz1+4+Eh2Z72lVbkEkhbnitjW3Q== X-Received: by 2002:a19:2256:: with SMTP id i83mr492082lfi.602.1610393155621; Mon, 11 Jan 2021 11:25:55 -0800 (PST) Received: from mail-lj1-f172.google.com (mail-lj1-f172.google.com. [209.85.208.172]) by smtp.gmail.com with ESMTPSA id u6sm85660lfk.127.2021.01.11.11.25.54 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 11 Jan 2021 11:25:54 -0800 (PST) Received: by mail-lj1-f172.google.com with SMTP id b10so150672ljp.6 for ; Mon, 11 Jan 2021 11:25:54 -0800 (PST) X-Received: by 2002:a2e:9b13:: with SMTP id u19mr420017lji.48.1610393153712; Mon, 11 Jan 2021 11:25:53 -0800 (PST) MIME-Version: 1.0 References: <20210108171517.5290-1-will@kernel.org> <20210111142402.6euyktmcnpemanf7@box> In-Reply-To: <20210111142402.6euyktmcnpemanf7@box> From: Linus Torvalds Date: Mon, 11 Jan 2021 11:25:37 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 0/3] Create 'old' ptes for faultaround mappings on arm64 with hardware access flag To: "Kirill A. Shutemov" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210111_142558_787513_2A72994D X-CRM114-Status: GOOD ( 15.09 ) 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: Android Kernel Team , Jan Kara , Minchan Kim , Catalin Marinas , Hugh Dickins , Linux Kernel Mailing List , Linux-MM , Vinayak Menon , "Kirill A . Shutemov" , Andrew Morton , Will Deacon , Linux ARM 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 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). Linus _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel