Re: [PATCH 0/1] nvme: Export CSTS register via sysfs
From: Keith Busch <kbusch@kernel.org>
Date: 2021-03-19 15:22:45
On Fri, Mar 19, 2021 at 07:51:58AM +0100, Christoph Hellwig wrote:
On Thu, Mar 18, 2021 at 12:46:53PM -0700, Keith Busch wrote:quoted
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.
I was thinking the driver wouldn't opt-in if there were read side effects, but yeah, it's too fragile. I withdraw the suggestion. _______________________________________________ Linux-nvme mailing list Linux-nvme@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-nvme