The correct condition is to check the number of ivhd entries fit into
the array.
Reported by: bz
Sponsored by: The FreeBSD Foundation
Differential D31514
vmm: Fix wrong assert in ivhd_dev_add_entry khng on Aug 12 2021, 6:58 AM. Authored by Tags None Referenced Files
Details The correct condition is to check the number of ivhd entries fit into Reported by: bz
Diff Detail
Event TimelineComment Actions I changed the text to this but swapping the < to > makes things boot! Thanks so much for your quick response! diff --git sys/amd64/vmm/amd/ivrs_drv.c sys/amd64/vmm/amd/ivrs_drv.c index 68c31788e29d..790b429bd1c8 100644 --- sys/amd64/vmm/amd/ivrs_drv.c +++ sys/amd64/vmm/amd/ivrs_drv.c @@ -184,8 +184,9 @@ ivhd_dev_add_entry(struct amdvi_softc *softc, uint32_t start_id, { struct ivhd_dev_cfg *dev_cfg; - KASSERT(softc->dev_cfg_cap <= softc->dev_cfg_cnt, - ("Impossible case: number of dev_cfg exceeding capacity")); + KASSERT(softc->dev_cfg_cap >= softc->dev_cfg_cnt, ("Impossible case: " + "dev_cfg exceeding capacity: dev_cfg_cap %d >= dev_cfg_cnt %d", + softc->dev_cfg_cap, softc->dev_cfg_cnt)); if (softc->dev_cfg_cap == softc->dev_cfg_cnt) { if (softc->dev_cfg_cap == 0) softc->dev_cfg_cap = 1; |