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)
Tue, May 14, 3:32 AM
Unknown Object (File)
Apr 28 2024, 7:10 PM
Unknown Object (File)
Apr 26 2024, 11:07 PM
Unknown Object (File)
Apr 26 2024, 9:52 PM
Unknown Object (File)
Apr 26 2024, 4:37 PM
Unknown Object (File)
Apr 26 2024, 2:26 PM
Unknown Object (File)
Apr 18 2024, 10:11 PM
Unknown Object (File)
Apr 17 2024, 3:24 AM

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.