提交 f73f8a50 编写于 作者: H Haiyang Zhang 提交者: Lorenzo Pieralisi

PCI: hv: Use bytes 4 and 5 from instance ID as the PCI domain numbers

As recommended by Azure host team, the bytes 4, 5 have more uniqueness
(info entropy) than bytes 8, 9 so use them as the PCI domain numbers.

On older hosts, bytes 4, 5 can also be used -- no backward compatibility
issues are introduced and 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: NMichael Kelley <mikelley@microsoft.com>
Signed-off-by: NHaiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: NSasha Levin <sashal@kernel.org>
上级 be700103
...@@ -2590,7 +2590,7 @@ static int hv_pci_probe(struct hv_device *hdev, ...@@ -2590,7 +2590,7 @@ static int hv_pci_probe(struct hv_device *hdev,
* (2) There will be no overlap between domains (after fixing possible * (2) There will be no overlap between domains (after fixing possible
* collisions) in the same VM. * 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); dom = hv_get_dom_num(dom_req);
if (dom == HVPCI_DOM_INVALID) { if (dom == HVPCI_DOM_INVALID) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册