Small NvmExpressDxe driver

Contents:
- NvmExpressDxe_Small.ffs: 6024 bytes
- NvmExpressDxe_Small_Compressed.ffs: 3829 bytes
- NvmExpressDxe_Small.efi: 5952 bytes

Changes:
- Based on UDK2017 NvmExpressDxe
- Includes bug fixes from UDK2018
- Removed functionality not present in UDK2014 (not supported by AMI Aptio 4 either)
- Removed component name protocol support (useful for debugging only)
- Removed driver unload support (not used outside of the EFI Shell)
- Bug fixes and improvements preserved
- Refactored for smaller code

Please feel free to use the binaries and to provide feedback.

Thank you.

NvmExpressDxe_Small.zip (11.5 KB)

@Ethaniel :
Thanks for having drastically shrinked the size of the NvmExpressDxe module, which may be very useful for users with limited free space within the DXE Driver Volume of their AMI Aptio IV UEFI BIOS.
I will test your FFS module as soon as possible with my Z68 system and give here my feedback.
Thanks again for your efforts!

@Ethaniel :
I just have played a little bit with your small NvmExpressDxe modules and found, that no module name will be shown within any tool, which is able to open an AMI Aptio UEFI BIOS (UEFITool or MMTool).
This has no impact on the functionality of the module, but is a precondition for its usage. The user must be able to see and find this module within the BIOS.
Can you modify the files according to this requirement? You should give the module a name, which is different from the previously used ones.

Thanks!

@Fernando :
Thank you for your feedback.
Updated FFS files to have NvmExpressDxe_Small module name.
Please let me know if you have any other recommendations.

That would be ok. Alternatively you can name it “NvmExpressDxe_S” (will be shorter).


That would make only 6 and 8 bytes difference for the compressed and uncompressed FFS respectively that I think is not worth the loss in usability. Note that an update could be named NvmExpressDxe_Small_2.
I’m however fine with changing the name if it has any benefits.

Did you have a chance to test it with your Z68 system?

Thank you.

Yes, I can test it as soon as I have the required time.
Shall I wait until you have added the code for the module’s shown name?


NvmExpressDxe_Small module name is already in the .ffs files. Please feel free to go ahead with testing when you have time.

Note that changing the module name (or anything else) in the .ffs files require no recompilation of the .efi driver file and thus requires no extensive testing.
I performed tests using a virtual and a physical machine with built-in NVMe drivers removed, but unfortunately I have no access to a system that has no built-in NVMe drivers, so testing on such a system is greatly appreciated.

Thank you.

Thanks!
I didn’t yet realize, that you had silently updated the previously attached files.

Sorry for the confusion, I just did not wanted to introduce versioning yet.

That is ok.
After having inserted your recently uploaded file named NvmExpressDxe_Small.ffs into the latest BIOS for my Z68 mainboard, it looks good regarding the shown name.
Here are the related pictures (left: AMI MMTool v4.50.0.23, right: UEFITool v0.22.4)

NVMe Module small after insertion Pic MMTool.png

NVMe Module small after insertion Pic UEFITool.png

Looks good to me, thank you.
Please let me know when you had a chance to test the driver functionality.

Meanwhile I have tested your “small” NvmExpressDxe module with my Z68 chipset system running Win10 x64 v1803 on a Samsung 960 EVO SSD.
The SSD was running on my Z170 system before and I simply removed the M.2 SSD from the other system, put it into an M.2>PCIe adapter and inserted it into the 1. PCIe slot of my ASUS P8Z68-V system.
After having flashed the modded BIOS, where I had inserted your NvmExpressDxe_Small.ffs instead of the previously inserted NvmExpressDxe_3.ffs, I just customized the BIOS settings within the “BOOT” section and started the PC.
Result: It worked flawlessly!

Thank you very much for your work and congratulations for the quality of it!

Since I wanted not only to know, whether your “small” NVMe EFI module works at all, but also, whether there is any performance difference between the “small” and the much bigger NvmExpressDxe_3 module, I have done some benchmark tests with both BIOS module variants. In both cases the NVMe Controller used the NVMe driver v2.3.0.1709.
Here are the benchmark results (they would have been better, if I would have done a clean OS installation and used some performance boost actions):

A. NvmExpressDxe_3:

Z68-NVMe-960EVO-Samsung2301709-NVMe_3.png



B. NvmExpressDxe_Small:

Z68-NVMe-960EVO-Samsung2301709-NVMe_Small.png



As you can see, there is no real performance difference outside the measuring tolerance. By chance your “small” variant gave my test system even slightly better scores than the much bigger “old” module.

EDIT: Although I haven’t measured the boot time difference, I got the impression, that my NVMe system booted faster with the “small” variant of the NVMe BIOS module.

Thank you very much, @Fernando , for testing NvmExpressDxe_Small and sharing the results. I’m glad you had a good experience.

Note that NvmExpressDxe is an UEFI boot driver that gets abandoned after the OS takes over during the boot process. OS drivers reconfigure the NVMe controller as part of initialization, so NvmExpressDxe should not affect performance after the OS takes over. Your test confirms that NvmExpressDxe_Small is functioning as expected because it has no impact on the performance of the OS.

I know that and didn’t expect any performance difference, but many users want to see the proof for it. That is why I have done the additional benchmark comparison test.

Updated NvmExpressDxe_Small with slightly smaller binaries.

I’ve performed some more testing and the driver is now ready for use when the DXE volume is low on free space, so I’ve removed the [Experimental] tag.

I still recommend the use of the full version of NvmExpressDxe when having enough free space.

@Ethaniel :
Thanks for having optimized your “small” NvmExpressDxe.ffs modules.
I will test it tomorrow with my Z68 system and update the start post of >this< thread, if everything works fine again.

As you may have already realized, I do not offer anymore “pure” NVMe *.efi files within the above linked thread for an update of an already existing NVMe DXE Driver. The reason is, that found out, that such replacement of the PE32 Image body has no effect on the shown name of the updated DXE Driver. The name stays the same as before the replacement. That means, that the real identity of the shown updated DXE Driver (e.g. “Dxe_3” " or “Dxe_Small”) cannot be identified by its name from within the UEFITool.
Do you see any chance to solve this problem? If not, I will not offer any *.efi files within the start post of >this< thread (to avoid any confusion for the users).

The displayed name is contained in the User interface section.
UEFITool is capable of updating that if you have a new User interface section prepared, but you have to use the GenSec tool to generate one, because UEFITool has no editor for that.
I agree that it makes more sense not to offer the .efi file separately. An advanced user can easily extract .efi files from .ffs files anyway.

@Fernando :
I was able to shrink it more by using an older compiler. Could you please update your thread with these if you get a chance to test it.
I noticed that you’ve already updated your thread with the previous one, sorry for the too frequent updates, I appreciate your efforts. Note that I don’t plan more releases unless an issue is found.

@Ethaniel :
Thanks for the re-shrinked and customized new uncompressed and pre-compressed varants of the “NvmExpressDxe_Small” DXE Drivers.
After having successfully tested the new uncompressed FFS file dated 03/23/2018, I have just updated again the start post of >this< thread.

Thanks again!