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)
Sat, Jan 11, 8:16 AM
Unknown Object (File)
Dec 7 2024, 4:47 PM
Unknown Object (File)
Nov 24 2024, 4:34 AM
Unknown Object (File)
Nov 22 2024, 6:24 AM
Unknown Object (File)
Nov 20 2024, 12:05 AM
Unknown Object (File)
Nov 7 2024, 10:33 PM
Unknown Object (File)
Nov 4 2024, 4:12 PM
Unknown Object (File)
Oct 17 2024, 5:13 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.