UEFI specification 2.9A requires to display the EUI-64 "in hexadecimal
format with byte 7 first (i.e., on the left) and byte 0 last".
This is in contrast to what the NVMe specification wants.
But it is what EDK II has been implementing.
Here is an example with the patch applied:
qemu-system-aarch64 -machine virt -cpu cortex-a72 -nographic \
-bios denx/u-boot.bin \
-device nvme,id=nvme1,serial=
9ff81223 \
-device nvme-ns,bus=nvme1,drive=nvme1n0,eui64=0x123456789ABCDEF0 \
-drive file=arm64.img,if=none,format=raw,id=nvme1n0
=> nvme scan
=> efidebug devices
Device Path
====================
/VenHw(…)/NVMe(0x1,f0-de-bc-9a-78-56-34-12)
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
struct efi_device_path_nvme *ndp =
(struct efi_device_path_nvme *)dp;
u32 ns_id;
- int i;
memcpy(&ns_id, &ndp->ns_id, sizeof(ns_id));
s += sprintf(s, "NVMe(0x%x,", ns_id);
- for (i = 0; i < sizeof(ndp->eui64); ++i)
+
+ /* Display byte 7 first, byte 0 last */
+ for (int i = 0; i < 8; ++i)
s += sprintf(s, "%s%02x", i ? "-" : "",
- ndp->eui64[i]);
+ ndp->eui64[i ^ 7]);
s += sprintf(s, ")");
break;