]> git.baikalelectronics.ru Git - kernel.git/commit
PCI: hv: Detect and fix Hyper-V PCI domain number collision
authorHaiyang Zhang <haiyangz@microsoft.com>
Thu, 15 Aug 2019 17:01:37 +0000 (17:01 +0000)
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Wed, 21 Aug 2019 07:15:19 +0000 (08:15 +0100)
commit2320f347239549a8094967186176c78632175750
tree335df80c063be4cc71b8121c983e89089d3aeefd
parente1e8ada394e2382928f0fee3eb68c75e2d92e2c7
PCI: hv: Detect and fix Hyper-V PCI domain number collision

Currently in Azure cloud, for passthrough devices, the host sets the
device instance ID's bytes 8 - 15 to a value derived from the host HWID,
which is the same on all devices in a VM. So, the device instance ID's
bytes 8 and 9 provided by the host are no longer unique. This affects
all Azure hosts since July 2018, and can cause device passthrough to VMs
to fail because the bytes 8 and 9 are used as PCI domain number.
Collision of domain numbers will cause the second device with the same
domain number fail to load.

In the cases of collision, we will detect and find another number that is
not in use.

Suggested-by: Michael Kelley <mikelley@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: Sasha Levin <sashal@kernel.org>
drivers/pci/controller/pci-hyperv.c