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=-5.5 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,USER_AGENT_SANE_1 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 6357FC433DB for ; Fri, 19 Mar 2021 06:52:19 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 7CB7564F62 for ; Fri, 19 Mar 2021 06:52:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7CB7564F62 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=R9Y+7e3waPHfqwVcPGnzUKy0d5h1zasw2Ec14AwkT1M=; b=QYm3v4+5mu2ssfGZLUdKFv9dH T7GV+hLuR60N+uDDqD6TQ+cnlDhkwNj+QqiEX7Nph1d6EhlJ0efx6l3QEw44TshC6UMyi66O8aaXQ hUC9kjQOI0qFvPrKfxMc9ejxsKxtPUIhLEykw1r/Fj5r1GrLSj0WgXadfxJYO9oKmIRZm9Zn5aBgn oGbm+ZsEapUDW0o99vypvFRJ64N0bki/X2McZhH+sWLbjWtS3XddL/g6WYtZJAOyI/NFbQwf3r34Z CGBNQZ3q7SbIHj91LThsQhruZR/XQx/BcgspiHftqAdEtEk+zykdTfXrL0pTig+lYhS6iL+lRX0Rp rQyngS52A==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lN8zO-006jNc-EX; Fri, 19 Mar 2021 06:52:06 +0000 Received: from verein.lst.de ([213.95.11.211]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lN8zK-006jNI-0I for linux-nvme@lists.infradead.org; Fri, 19 Mar 2021 06:52:03 +0000 Received: by verein.lst.de (Postfix, from userid 2407) id 1F49868BEB; Fri, 19 Mar 2021 07:51:58 +0100 (CET) Date: Fri, 19 Mar 2021 07:51:58 +0100 From: Christoph Hellwig To: Keith Busch Cc: Alan Adamson , Christoph Hellwig , "linux-nvme@lists.infradead.org" , "axboe@fb.com" , "sagi@grimberg.me" Subject: Re: [PATCH 0/1] nvme: Export CSTS register via sysfs Message-ID: <20210319065158.GA11263@lst.de> References: <20210317204615.13971-1-alan.adamson@oracle.com> <20210318043828.GB26988@lst.de> <0D18CE6C-4390-4040-98A6-14204DE33253@oracle.com> <20210318165213.GA31675@redsun51.ssa.fujisawa.hgst.com> <0D017D65-3D7C-4165-B25B-21E6A6FFDED5@oracle.com> <20210318194653.GA2690@dhcp-10-100-145-180.wdc.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210318194653.GA2690@dhcp-10-100-145-180.wdc.com> User-Agent: Mutt/1.5.17 (2007-11-01) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210319_065202_198236_AA85D68A X-CRM114-Status: GOOD ( 13.85 ) X-BeenThere: linux-nvme@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-nvme" Errors-To: linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org On Thu, Mar 18, 2021 at 12:46:53PM -0700, Keith Busch wrote: > I don't think it should require user space modifications. Just mmap the > current resource as-is but let the driver allow read-only in the > precense of CONFIG_IO_STRICT_DEVMEM. The below is a rough idea of what I > had in mind (compile tested only, and a proper solution should restrict > access to a specific address range) I think this is a horrible idea. Userspace has no business touching registers even read-only. MMIO reads can have side effects as well, intentional or unintentional, and we also open up a whole can of worms of mismatched memory attributes. _______________________________________________ Linux-nvme mailing list Linux-nvme@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-nvme