[PATCH 0/1] nvme: Export CSTS register via sysfs

Keith Busch kbusch at kernel.org
Thu Mar 18 16:52:13 GMT 2021


On Thu, Mar 18, 2021 at 04:28:24PM +0000, Alan Adamson wrote:
> 
> 
> > On Mar 17, 2021, at 9:38 PM, Christoph Hellwig <hch at lst.de> wrote:
> > 
> > On Wed, Mar 17, 2021 at 04:46:14PM -0400, Alan Adamson wrote:
> >> This patch exports the NVMe Controller CSTS register via sysfs.  This
> >> feature can be used by userland executables that accessed CSTS and
> >> possibly other registers by mapping them into user space.  Since this ability
> >> may not always available, exporting certain registers via sysfs provides
> >> a safe/read-only way to access registers from outside the kernel.
> > 
> > So what is this application doings with it?  Should we just have a
> > ready attribute instead of exporting a raw register encoding?
> 
> 
> Was using nvme-cli show-regs to manage nvme devices. This is no longer an option.

Most distributions ship with kernel CONFIG_IO_STRICT_DEVMEM these days,
so that user command will very rarely work on PCIe targets anymore.

Perhaps we could introduce a driver option allowing read-only mmap on
this memory?  While you're currently asking for just one register
attribute, it would be nice if we can make all future requests available
without piling on more sysfs properties.



More information about the Linux-nvme mailing list