-
Notifications
You must be signed in to change notification settings - Fork 697
It's more of a "feature" than an issue. The kernel will not allow user space to map a device's IO memory when that config option is set and the tooling can't get around that limitation.
When the Linux kernel is configured with CONFIG_IO_STRICT_DEVMEM, the kernel prevents user space to map IO memory to userspace. Either compile a kernel without this option enabled or set the kernel command line option iomem=relaxed.
Also when secure boot is enabled the lockdown is activated, which prevents mapping PCI bars to user space.
nvme-cli v2 relies on the kernel reporting the correct disk/block size via the sysfs interface.
Also ensure libnvme has:
- https://github.com/linux-nvme/libnvme/pull/754/commits/9b3435bc9b2ff61e40284ed2d5d36dc39a46b3a5
- https://github.com/linux-nvme/libnvme/pull/803/commits/00efe8364b0a94e7057333f9bdf579dbc982429c
and Linux kernel has (v6.8):
nvme id-ns shows the correct disk/block size because it will issue a command to read the current value.
nvme-cli reads the firmware version from sysfs. Older kernel don't update the firmware entry in sysfs after an firmware upgrade. After
a reboot the correct version will be shown. Alternatively you can use nvme id-ctrl to check the firmware version.
Linux kernel fix (v6.2)
If this still doesn't fix your problem, it needs to be addressed in the kernel. nvme list is a non privileged operation and thus can't issue any NVMe Commands via the passthru interface. This is on purpose.
The workaround is to use nvme id-ctrl, reset the PCI device or reboot the machine.