git: db2a34bc4528 - stable/15 - nvmecontrol: Remove an incorrect use of PAGE_SIZE

From: Andrew Turner <andrew_at_FreeBSD.org>
Date: Wed, 08 Apr 2026 14:01:36 UTC
The branch stable/15 has been updated by andrew:

URL: https://cgit.FreeBSD.org/src/commit/?id=db2a34bc45288405ab6f41a667a141c32bf232a5

commit db2a34bc45288405ab6f41a667a141c32bf232a5
Author:     Andrew Turner <andrew@FreeBSD.org>
AuthorDate: 2026-02-18 14:20:57 +0000
Commit:     Andrew Turner <andrew@FreeBSD.org>
CommitDate: 2026-04-08 13:59:53 +0000

    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
    
    (cherry picked from commit bfb7c81f93b534f8c10928d80ea56c8177a6f39f)
---
 sbin/nvmecontrol/identify_ext.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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");