As recommended by Azure host team, the bytes 4, 5 have more uniqueness
(info entropy) than bytes 8, 9. So now we use bytes 4, 5 as the PCI domain
numbers. On older hosts, bytes 4, 5 can also be used -- no backward
compatibility issues here. The chance of collision is greatly reduced.

In the rare cases of collision, the driver code detects and finds another
number that is not in use.

Suggested-by: Michael Kelley <mikel...@microsoft.com>
Signed-off-by: Haiyang Zhang <haiya...@microsoft.com>
Acked-by: Sasha Levin <sas...@kernel.org>
---
 drivers/pci/controller/pci-hyperv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/controller/pci-hyperv.c 
b/drivers/pci/controller/pci-hyperv.c
index 31b8fd5..4f3d97e 100644
--- a/drivers/pci/controller/pci-hyperv.c
+++ b/drivers/pci/controller/pci-hyperv.c
@@ -2590,7 +2590,7 @@ static int hv_pci_probe(struct hv_device *hdev,
         * (2) There will be no overlap between domains (after fixing possible
         * collisions) in the same VM.
         */
-       dom_req = hdev->dev_instance.b[8] << 8 | hdev->dev_instance.b[9];
+       dom_req = hdev->dev_instance.b[5] << 8 | hdev->dev_instance.b[4];
        dom = hv_get_dom_num(dom_req);
 
        if (dom == HVPCI_DOM_INVALID) {
-- 
1.8.3.1

Reply via email to