summaryrefslogtreecommitdiff
path: root/src/netbsd_pci.c
diff options
context:
space:
mode:
authorStephen Hemminger <stephen@networkplumber.org>2017-09-18 13:17:23 -0400
committerAdam Jackson <ajax@redhat.com>2017-09-20 13:29:29 -0400
commita167bd6474522a709ff3cbb00476c0e4309cb66f (patch)
treeb3f6e17c7ddf2f824c2fc24cfd9ccc814435014f /src/netbsd_pci.c
parent4f1ac52e828eed1c410ee66304fcb7a17f25da40 (diff)
linux: support 32 bit PCI domains (v3)
The PCI domain may be larger than 16 bits on Microsoft Azure and other virtual environments. PCI busses reported by ACPI are limited to 16 bits, but in Azure the domain value for pass through devices is intentionally larger than 16 bits to avoid clashing with local devices. This is needed to support pass through of GPU devices. v3: (ajax) Update FreeBSD and Solaris backends to preserve the full 32-bit domain number, since on those OSes it stands a chance of working already. Update NetBSD and OpenBSD backends to initialize domain_16 compatibly with older libpciaccess; neither backend appears to support more than a handful of domains to begin with though. Trivially update the generic x86 backend for source compatibility, though it still only supports one domain and will never be better. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=101744 Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com> Reviewed-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'src/netbsd_pci.c')
-rw-r--r--src/netbsd_pci.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/netbsd_pci.c b/src/netbsd_pci.c
index f972f94..1f3bcea 100644
--- a/src/netbsd_pci.c
+++ b/src/netbsd_pci.c
@@ -959,6 +959,10 @@ pci_system_netbsd_create(void)
continue;
device->base.domain = domain;
+ if (domain > 0xffff)
+ device->base.domain_16 = 0xffff;
+ else
+ device->base.domain_16 = domain & 0xffff;
device->base.bus = bus;
device->base.dev = dev;
device->base.func = func;