]> 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)
commit8663a6d8e23dd3920fa5c1c088386df81bf47ac1
tree335df80c063be4cc71b8121c983e89089d3aeefd
parentc99edfe6fcf5b46d5f61d9919bf56fbbc218d8d9
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