aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Turner <andrew@FreeBSD.org>2026-02-18 14:20:57 +0000
committerAndrew Turner <andrew@FreeBSD.org>2026-02-18 15:15:41 +0000
commitbfb7c81f93b534f8c10928d80ea56c8177a6f39f (patch)
tree51f6659b3efca08d8d67f6e300a9a0e0753d32c2
parenta6ad3d4ca05058b2b78f91be941e1da0bb272ff5 (diff)
nvmecontrol: Remove an incorrect use of PAGE_SIZE
The mdts value is in terms of the nvme page size, not the host page size. On many architectures these are both 4k, however on arm64 it is possible to build a system with the host page size of 16k. Use NVME_MPS_SHIFT to get the correct nvme page shift. Reviewed by: imp Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D55334
-rw-r--r--sbin/nvmecontrol/identify_ext.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sbin/nvmecontrol/identify_ext.c b/sbin/nvmecontrol/identify_ext.c
index 95ca4b5187d4..13b1d21ce97e 100644
--- a/sbin/nvmecontrol/identify_ext.c
+++ b/sbin/nvmecontrol/identify_ext.c
@@ -106,7 +106,7 @@ nvme_print_controller(struct nvme_controller_data *cdata)
if (cdata->mdts == 0)
printf("Unlimited\n");
else
- printf("%ld bytes\n", PAGE_SIZE * (1L << cdata->mdts));
+ printf("%ld bytes\n", 1L << (cdata->mdts + NVME_MPS_SHIFT));
printf("Sanitize Crypto Erase: %s\n",
NVMEV(NVME_CTRLR_DATA_SANICAP_CES, cdata->sanicap) != 0 ?
"Supported" : "Not Supported");