From a167bd6474522a709ff3cbb00476c0e4309cb66f Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Mon, 18 Sep 2017 13:17:23 -0400 Subject: 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 Reviewed-by: Eric Anholt --- src/openbsd_pci.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/openbsd_pci.c') diff --git a/src/openbsd_pci.c b/src/openbsd_pci.c index b8ce318..c061fd8 100644 --- a/src/openbsd_pci.c +++ b/src/openbsd_pci.c @@ -656,6 +656,10 @@ pci_system_openbsd_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; -- cgit v1.2.3