From f08d1570fa760e98d82ec209a948a42dc49ab0da Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Wed, 24 Mar 2021 09:29:15 -0700 Subject: [PATCH] bhyve hostbridge: Rename "device" property to "devid". "device" is already used as the generic PCI-level name of the device model to use (e.g. "hostbridge"). The result was that parsing "hostbridge" as an integer failed and the host bridge used a device ID of 0. The EFI ROM asserts that the device ID of the hostbridge is not 0, so booting with the current EFI ROM was failing during the ROM boot. Fixes: 621b5090487de9fed1b503769702a9a2a27cc7bb (cherry picked from commit 9f40a3be3d5dbddf782c3d1eeaadcd022a4dad01) --- usr.sbin/bhyve/bhyve_config.5 | 4 ++-- usr.sbin/bhyve/pci_hostbridge.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/usr.sbin/bhyve/bhyve_config.5 b/usr.sbin/bhyve/bhyve_config.5 index 4e200a779d5..d65040513cb 100644 --- a/usr.sbin/bhyve/bhyve_config.5 +++ b/usr.sbin/bhyve/bhyve_config.5 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd March 18, 2021 +.Dd March 24, 2021 .Dt BHYVE_CONFIG 5 .Os .Sh NAME @@ -335,7 +335,7 @@ process. .It Sy Name Ta Sy Format Ta Sy Default Ta Sy Description .It Va vendor Ta integer Ta 0x1275 Ta PCI vendor ID. -.It Va device Ta integer Ta 0x1275 Ta +.It Va devid Ta integer Ta 0x1275 Ta PCI device ID. .El .Ss AHCI Controller Settings diff --git a/usr.sbin/bhyve/pci_hostbridge.c b/usr.sbin/bhyve/pci_hostbridge.c index 7099474eaf9..9fce225bb1d 100644 --- a/usr.sbin/bhyve/pci_hostbridge.c +++ b/usr.sbin/bhyve/pci_hostbridge.c @@ -48,7 +48,7 @@ pci_hostbridge_init(struct vmctx *ctx, struct pci_devinst *pi, nvlist_t *nvl) value = get_config_value_node(nvl, "vendor"); if (value != NULL) vendor = strtol(value, NULL, 0); - value = get_config_value_node(nvl, "device"); + value = get_config_value_node(nvl, "devid"); if (value != NULL) device = strtol(value, NULL, 0); @@ -69,7 +69,7 @@ pci_amd_hostbridge_legacy_config(nvlist_t *nvl, const char *opts) { set_config_value_node(nvl, "vendor", "0x1022"); /* AMD */ - set_config_value_node(nvl, "device", "0x7432"); /* made up */ + set_config_value_node(nvl, "devid", "0x7432"); /* made up */ return (0); } -- 2.45.2