summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bhyve
diff options
context:
space:
mode:
authorneel <neel@FreeBSD.org>2012-08-06 07:20:25 +0000
committerneel <neel@FreeBSD.org>2012-08-06 07:20:25 +0000
commit75106bd2988aa440d8beba6c6a92b55742c691b7 (patch)
treeb430772aef767e0af67ed5a0b4d5ce8fba5beb0d /usr.sbin/bhyve
parentd4dec7419041f5934130a79960faf398446e95dd (diff)
downloadFreeBSD-src-75106bd2988aa440d8beba6c6a92b55742c691b7.zip
FreeBSD-src-75106bd2988aa440d8beba6c6a92b55742c691b7.tar.gz
Fix a bug in how a 64-bit bar in a pci passthru device would be presented to
the guest. Prior to the fix it was possible for such a bar to appear as a 32-bit bar as long as it was allocated from the region below 4GB. This had the potential to confuse some drivers that were particular about the size of the bars. Obtained from: NetApp
Diffstat (limited to 'usr.sbin/bhyve')
-rw-r--r--usr.sbin/bhyve/pci_emul.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.sbin/bhyve/pci_emul.c b/usr.sbin/bhyve/pci_emul.c
index 92c8715..96667d5 100644
--- a/usr.sbin/bhyve/pci_emul.c
+++ b/usr.sbin/bhyve/pci_emul.c
@@ -455,8 +455,13 @@ pci_emul_alloc_bar(struct pci_devinst *pdi, int idx, uint64_t hostbase,
lobits = PCIM_BAR_MEM_SPACE | PCIM_BAR_MEM_64 |
PCIM_BAR_MEM_PREFETCH;
break;
+ } else {
+ baseptr = &pci_emul_membase32;
+ limit = PCI_EMUL_MEMLIMIT32;
+ mask = PCIM_BAR_MEM_BASE;
+ lobits = PCIM_BAR_MEM_SPACE | PCIM_BAR_MEM_64;
}
- /* fallthrough */
+ break;
case PCIBAR_MEM32:
baseptr = &pci_emul_membase32;
limit = PCI_EMUL_MEMLIMIT32;
OpenPOWER on IntegriCloud