aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWanpengQian <wanpengqian@gmail.com>2022-08-14 15:28:05 +0000
committerCorvin Köhne <corvink@FreeBSD.org>2022-11-14 08:23:03 +0000
commit839b6e33089bee5873cf3fcd402260aa4d405f49 (patch)
tree67607455667f8be51aa76e503b03cab75eea7721
parent440ccb313c70cc763323545fc3e17939bc82eaf0 (diff)
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 (cherry picked from commit 3cae10048d27f805d7fc909b123ddee34be0268e)
-rw-r--r--usr.sbin/bhyve/pci_nvme.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/usr.sbin/bhyve/pci_nvme.c b/usr.sbin/bhyve/pci_nvme.c
index 98410b92039c..15d6ae777cc6 100644
--- a/usr.sbin/bhyve/pci_nvme.c
+++ b/usr.sbin/bhyve/pci_nvme.c
@@ -695,6 +695,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