diff options
author | WanpengQian <wanpengqian@gmail.com> | 2022-08-14 15:28:05 +0000 |
---|---|---|
committer | Chuck Tuffli <chuck@FreeBSD.org> | 2022-08-14 16:59:36 +0000 |
commit | 3cae10048d27f805d7fc909b123ddee34be0268e (patch) | |
tree | 2e26b551e54be4432eb4cbb0c6f92ddc6e1c717b | |
parent | eae0210cdd2e22c2eb9bc652f2136b3386a663a4 (diff) | |
download | src-3cae10048d27f805d7fc909b123ddee34be0268e.tar.gz src-3cae10048d27f805d7fc909b123ddee34be0268e.zip |
bhyve nvme: Fix Active Firmware Info
Summary:
Currently Active Firmware Info is not initialized.
Fix is to initialize the Active Firmware Info to Slot 1.
Test Plan: Within FreeBSD/Linux guests, show the Firmware Logpage to confirm.
Reviewed By: chuck
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D32658
-rw-r--r-- | usr.sbin/bhyve/pci_nvme.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/usr.sbin/bhyve/pci_nvme.c b/usr.sbin/bhyve/pci_nvme.c index 93edd96a0d0d..afb5327ecd20 100644 --- a/usr.sbin/bhyve/pci_nvme.c +++ b/usr.sbin/bhyve/pci_nvme.c @@ -698,6 +698,11 @@ pci_nvme_init_logpages(struct pci_nvme_softc *sc) sc->health_log.temperature = NVME_TEMPERATURE; sc->health_log.available_spare = 100; sc->health_log.available_spare_threshold = 10; + + /* Set Active Firmware Info to slot 1 */ + sc->fw_log.afi = (1 << NVME_FIRMWARE_PAGE_AFI_SLOT_SHIFT); + memcpy(&sc->fw_log.revision[0], sc->ctrldata.fr, + sizeof(sc->fw_log.revision[0])); } static void |