|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [xen stable-4.16] pci: fix pci_get_pdev_by_domain() to always account for the segment
commit b0806d84d48d983d40a29534e663652887287a78
Author: Roger Pau Monné <roger.pau@xxxxxxxxxx>
AuthorDate: Tue May 23 15:03:41 2023 +0200
Commit: Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue May 23 15:03:41 2023 +0200
pci: fix pci_get_pdev_by_domain() to always account for the segment
When a domain parameter is provided to pci_get_pdev_by_domain() the
search function would match against bus and devfn, without taking the
segment into account.
Fix this and also account for the passed segment.
Fixes: 8cf6e0738906 ('PCI: simplify (and thus correct)
pci_get_pdev{,_by_domain}()')
Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
master commit: c7908869ac26961a3919491705e521179ad3fc0e
master date: 2023-05-22 16:11:55 +0200
---
xen/drivers/passthrough/pci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index da4ecda814..a9da7367c2 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -570,7 +570,7 @@ struct pci_dev *pci_get_pdev_by_domain(const struct domain
*d, uint16_t seg,
}
else
list_for_each_entry ( pdev, &d->pdev_list, domain_list )
- if ( pdev->bus == bus && pdev->devfn == devfn )
+ if ( pdev->seg == seg && pdev->bus == bus && pdev->devfn == devfn )
return pdev;
return NULL;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.16
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |