bhyve: do not exit if LPC finds no host selector
The host selector is only required when the user likes to use the same LPC device IDs as the physical LPC device. This is an uncommon use case. For that reason, it makes no sense to exit when we don't find the host selector. Reviewed by: markj MFC after: 1 week Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D39311
This commit is contained in:
@@ -480,6 +480,8 @@ pci_lpc_get_sel(struct pcisel *const sel)
|
||||
}
|
||||
}
|
||||
|
||||
warnx("%s: Unable to find host selector of LPC bridge.", __func__);
|
||||
|
||||
return (-1);
|
||||
}
|
||||
|
||||
@@ -487,6 +489,7 @@ static int
|
||||
pci_lpc_init(struct pci_devinst *pi, nvlist_t *nvl)
|
||||
{
|
||||
struct pcisel sel = { 0 };
|
||||
struct pcisel *selp = NULL;
|
||||
uint16_t device, subdevice, subvendor, vendor;
|
||||
uint8_t revid;
|
||||
|
||||
@@ -511,15 +514,15 @@ pci_lpc_init(struct pci_devinst *pi, nvlist_t *nvl)
|
||||
if (lpc_init(pi->pi_vmctx) != 0)
|
||||
return (-1);
|
||||
|
||||
if (pci_lpc_get_sel(&sel) != 0)
|
||||
return (-1);
|
||||
if (pci_lpc_get_sel(&sel) == 0)
|
||||
selp = &sel;
|
||||
|
||||
vendor = pci_config_read_reg(&sel, nvl, PCIR_VENDOR, 2, LPC_VENDOR);
|
||||
device = pci_config_read_reg(&sel, nvl, PCIR_DEVICE, 2, LPC_DEV);
|
||||
revid = pci_config_read_reg(&sel, nvl, PCIR_REVID, 1, LPC_REVID);
|
||||
subvendor = pci_config_read_reg(&sel, nvl, PCIR_SUBVEND_0, 2,
|
||||
vendor = pci_config_read_reg(selp, nvl, PCIR_VENDOR, 2, LPC_VENDOR);
|
||||
device = pci_config_read_reg(selp, nvl, PCIR_DEVICE, 2, LPC_DEV);
|
||||
revid = pci_config_read_reg(selp, nvl, PCIR_REVID, 1, LPC_REVID);
|
||||
subvendor = pci_config_read_reg(selp, nvl, PCIR_SUBVEND_0, 2,
|
||||
LPC_SUBVEND_0);
|
||||
subdevice = pci_config_read_reg(&sel, nvl, PCIR_SUBDEV_0, 2,
|
||||
subdevice = pci_config_read_reg(selp, nvl, PCIR_SUBDEV_0, 2,
|
||||
LPC_SUBDEV_0);
|
||||
|
||||
/* initialize config space */
|
||||
|
||||
Reference in New Issue
Block a user