Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp1051855rwn; Thu, 8 Sep 2022 12:35:52 -0700 (PDT) X-Google-Smtp-Source: AA6agR5jKZz8QHA5bCFvhB9YOkMEmPHeGVCwt3NwW93kEelyBxCljgeJLedjP9zljr/ELh7IUryz X-Received: by 2002:a17:903:2289:b0:177:ab99:9f9 with SMTP id b9-20020a170903228900b00177ab9909f9mr8207549plh.78.1662665752336; Thu, 08 Sep 2022 12:35:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662665752; cv=none; d=google.com; s=arc-20160816; b=x7Ph/Zq0avm/YtB+3GJ+sXJbdb9A29qB9jakn5x6XFmTmLndIXJI5OnXSUn2laZsdo 8zkt9f7x9nWib2bPMEi53I8xzGe4IzXk+UaF6p7ODRqUqRg/98QFqk5qYRje+Tzekfsa Jj0DJFnT2YDDMAHp/sgACgi2fGK+KVkCWPWlwAlCNNAJNMsvcQ5amTltBc2aUZBZoYVi eQf8lU8fM6y781DwrmvgmnimC6UnhaQXZ6/4kCBT6xgsbaDkDGh4ugBighdZa8URR0XU Y+yHiLwwd4lQPOQEPJO98INZNj4H3hkNfDZTKUvQUnUtMKhcoD4w9EZJ1AiB+D57gFwy ZAGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=eMRpvkz5BHGreaY+PFzuwrNAMyJo1PrgAXdebzyX1bQ=; b=Hdj/yLDvsKoGon4LdyzL+bRjSrao4vOLOftS3oUrd4VMMi9EBUUxQyGqzRjMFjgpBs DfoIW2XfboF2BXxAn8VArvICRbkBHV5dDnNJvcyWO7MfgLRcSrRqgS2iCY7YErx61vEM WMf3pQtK9UoGrewTB08yWQD6/Pvklp1w1S0etXiyre/Dbo9DY/UYUNfX+BAHk4lofxQs dCXo/U77mXC3pgUDZCzaEFm9oW93AouXf/MIuK2hq+1xZE3f6+pOT81KkosOyv6KqCcT 5AG5NM3bclaXJQ9xZauGZpgeL1lTlVGI+Ix+qwHFy4FS9u+M+EmD1PWTHplsudJe3vQu BulA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20210112.gappssmtp.com header.s=20210112 header.b=EAxgJt6m; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lk16-20020a17090b33d000b001fdb1694973si1102678pjb.157.2022.09.08.12.35.40; Thu, 08 Sep 2022 12:35:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20210112.gappssmtp.com header.s=20210112 header.b=EAxgJt6m; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231674AbiIHSOk (ORCPT + 99 others); Thu, 8 Sep 2022 14:14:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231812AbiIHSOW (ORCPT ); Thu, 8 Sep 2022 14:14:22 -0400 Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28B52E72D6 for ; Thu, 8 Sep 2022 11:14:20 -0700 (PDT) Received: by mail-pg1-x535.google.com with SMTP id c24so17490643pgg.11 for ; Thu, 08 Sep 2022 11:14:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=eMRpvkz5BHGreaY+PFzuwrNAMyJo1PrgAXdebzyX1bQ=; b=EAxgJt6mMMItIbhwv7qA+mTjUUPZvXlnbr28f8qnEOfklqfv8N6sl5jr03xZo8m7wk O33rZvP4lC2AXuGMkCcO4A3sK7x02HGPc8tEF3CaJjVhYDJ1gfkchwRH/WHIokemDGn+ /U4Y9R+uW0qlwl0cB9bp/3Tf2xD9On15uwwQgU/9iFZOf7S/M20oQJL9aR5eQdM/lsEN WPfqAnH8fRjIo0OaSB4x0i7NxhhiKmxLACM3YK429Dg7ztSxuP8Fi60r6+gzic99t4Gm u3ZYmid9TNY1uJNg124RKrdlEThEO6V8U/IfbB47DxoF5DuFNapU1EgwbTOIlm8tbvA9 o4vQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=eMRpvkz5BHGreaY+PFzuwrNAMyJo1PrgAXdebzyX1bQ=; b=5oWjWrTqdnoVNGr52NNMuTOpSjf4cMzDYDLGfUvoZPujeDRWp5jXDJ7T51t7JlOEsw m1mCVkI/3W1T2zcmJTeSiMpgEtsZjWQBT9HgjGL2LTRJtXKTVhpawqgV1xSkfEGApEVC WqRiv7B+a4hL/4MCfAkFJZZHFs/lgXx3n3eyahgeDidDr/hXWem9LeN6LvzmaNdJOmES WfsY89r2jmnMQgzqW2+L/HIddsWiiMK6i6cU36ka2OHU3N6s5S4QA0lmgeVNY25qA53V yzaCuOiFMsOWJero4lW15A1mJLTSgtOkjYdbv8n+J8kRztT0ZGqZ+N3ss42C+o7D9R7t g0Jw== X-Gm-Message-State: ACgBeo1yzX943Tx67X8Dgf8ngIEnJsFx+MHamSxAEiZzmje4CRNN95P5 BRp0lIsoYowk/Xwf07BKt+FBRs02KeoO5hZOcCgprA== X-Received: by 2002:a63:8a4a:0:b0:434:c99c:6fd4 with SMTP id y71-20020a638a4a000000b00434c99c6fd4mr8584040pgd.24.1662660859653; Thu, 08 Sep 2022 11:14:19 -0700 (PDT) MIME-Version: 1.0 References: <20220908170133.1159747-1-abrestic@rivosinc.com> In-Reply-To: From: Andrew Bresticker Date: Thu, 8 Sep 2022 14:14:08 -0400 Message-ID: Subject: Re: [PATCH] riscv: Allow PROT_WRITE-only mmap() To: SS JieJi Cc: Palmer Dabbelt , Paul Walmsley , Atish Patra , Celeste Liu , dram , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 8, 2022 at 1:28 PM SS JieJi wrote: > > > https://fars.ee/1sPb, showing *inconsistent* read results on -r- pages > > before/after a write attempt performed by the kernel. > > That said, maybe prohibit mmap-ing -w- pages is not the best fix for > this issue. If -w- pages are irreplaceable for some use cases (and > hence need to be allowed), I'd suggest at least we need to re-fix the > read result inconsistency issue somewhere else despite simply > reverting the patch. Ah, this is because do_page_fault() also needs to be made aware of write-implying-read. Will send a v2 shortly. -Andrew > > Yours, Pan Ruizhe