mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-01-05 15:45:05 +00:00
hv: vpci: split vPCI device from SOS for post-launched VM
When assgined a PCI PTDev to post-launched VM from SOS, using a pointer to point to the real struct pci_vdev. When post-launched VM access its PTDev configure space in SOS address space, using this real struct pci_vdev. Tracked-On: #3475 Signed-off-by: Li, Fei1 <fei1.li@intel.com>
This commit is contained in:
@@ -74,7 +74,7 @@ void pci_vdev_write_cfg(struct pci_vdev *vdev, uint32_t offset, uint32_t bytes,
|
||||
* @pre vpci != NULL
|
||||
* @pre vpci->pci_vdev_cnt <= CONFIG_MAX_PCI_DEV_NUM
|
||||
*/
|
||||
struct pci_vdev *pci_find_vdev_by_vbdf(const struct acrn_vpci *vpci, union pci_bdf vbdf)
|
||||
struct pci_vdev *pci_find_vdev(const struct acrn_vpci *vpci, union pci_bdf vbdf)
|
||||
{
|
||||
struct pci_vdev *vdev, *tmp;
|
||||
uint32_t i;
|
||||
@@ -91,25 +91,3 @@ struct pci_vdev *pci_find_vdev_by_vbdf(const struct acrn_vpci *vpci, union pci_b
|
||||
|
||||
return vdev;
|
||||
}
|
||||
|
||||
/**
|
||||
* @pre vpci != NULL
|
||||
* @pre vpci->pci_vdev_cnt <= CONFIG_MAX_PCI_DEV_NUM
|
||||
*/
|
||||
struct pci_vdev *pci_find_vdev_by_pbdf(const struct acrn_vpci *vpci, union pci_bdf pbdf)
|
||||
{
|
||||
struct pci_vdev *vdev, *tmp;
|
||||
uint32_t i;
|
||||
|
||||
vdev = NULL;
|
||||
for (i = 0U; i < vpci->pci_vdev_cnt; i++) {
|
||||
tmp = (struct pci_vdev *)&(vpci->pci_vdevs[i]);
|
||||
|
||||
if ((tmp->pdev != NULL) && bdf_is_equal((union pci_bdf *)&(tmp->pdev->bdf), &pbdf)) {
|
||||
vdev = tmp;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return vdev;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user