Page MenuHomeFreeBSD

bhyve: fix incorrect Slot1 Read Only setting in NVMe controller.
ClosedPublic

Authored by wanpengqian_gmail.com on Oct 26 2021, 8:12 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, May 14, 10:47 PM
Unknown Object (File)
Sat, May 10, 3:21 PM
Unknown Object (File)
Apr 5 2025, 1:15 PM
Unknown Object (File)
Mar 18 2025, 7:58 AM
Unknown Object (File)
Feb 28 2025, 3:31 PM
Unknown Object (File)
Feb 21 2025, 8:38 PM
Unknown Object (File)
Feb 21 2025, 8:47 AM
Unknown Object (File)
Feb 11 2025, 9:27 PM

Details

Summary

The setting of Read-only firmware slot is incorrect.

Signed-off-by: Wanpeng Qian <wanpengqian@gmail.com>

Test Plan

Within FreeBSD/Linux guest, Identify NVMe controller to check the result.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

wanpengqian_gmail.com retitled this revision from bhyve: fix Number of Firmware Slot and Slot1 RealOnly is not advertised. to bhyve: fix Number of Firmware Slot and Slot1 ReadOnly advertise are ignored..Oct 26 2021, 10:12 AM
wanpengqian_gmail.com edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Oct 26 2021, 4:19 PM

Can anyone help this patch be committed to HEAD?

chuck requested changes to this revision.Mar 27 2022, 1:56 PM
chuck added inline comments.
usr.sbin/bhyve/pci_nvme.c
544

The emulation does not support Firmware Download/Commit, and thus, it should not advertise this capability.

This revision now requires changes to proceed.Mar 27 2022, 1:56 PM
usr.sbin/bhyve/pci_nvme.c
544

You are right. This bit shouldn't be set.
When I test this with nvmecontrol, I saw the follwing code in nvmecontrol/identify_ext.c

	printf("Firmware Slot 1 Read-Only:   ");
	if (fw != 0)
		printf("%s\n", fw_slot1_ro ? "Yes" : "No");
	else
		printf("N/A\n");

Apparently If we didn't set OACS firmware bit, the nvmecontrol will not print the ReadOnly attribute.
I will submit a change for nvmecontrol.

wanpengqian_gmail.com retitled this revision from bhyve: fix Number of Firmware Slot and Slot1 ReadOnly advertise are ignored. to bhyve: fix incorrect Slot1 Read Only setting in NVMe controller..Mar 29 2022, 6:49 AM
wanpengqian_gmail.com edited the summary of this revision. (Show Details)
This revision was not accepted when it landed; it landed in state Needs Review.Aug 14 2022, 6:19 PM
This revision was automatically updated to reflect the committed changes.