diff --git a/hypervisor/dm/vpci/partition_mode.c b/hypervisor/dm/vpci/partition_mode.c index d798cef9f..6632653b2 100644 --- a/hypervisor/dm/vpci/partition_mode.c +++ b/hypervisor/dm/vpci/partition_mode.c @@ -67,13 +67,13 @@ static inline bool is_valid_bar(const struct pci_bar *bar) return (is_valid_bar_type(bar) && is_valid_bar_size(bar)); } -static void partition_mode_pdev_init(struct pci_vdev *vdev) +static void partition_mode_pdev_init(struct pci_vdev *vdev, union pci_bdf pbdf) { struct pci_pdev *pdev_ref; uint32_t idx; struct pci_bar *pbar, *vbar; - pdev_ref = find_pci_pdev(vdev->pbdf); + pdev_ref = find_pci_pdev(pbdf); if (pdev_ref != NULL) { vdev->pdev = pdev_ref; @@ -107,10 +107,9 @@ static int32_t partition_mode_vpci_init(const struct acrn_vm *vm) ptdev_config = vm_config->pci_ptdevs + i; vdev->vpci = vpci; vdev->vbdf.value = ptdev_config->vbdf.value; - vdev->pbdf.value = ptdev_config->pbdf.value; if (vdev->vbdf.value != 0U) { - partition_mode_pdev_init(vdev); + partition_mode_pdev_init(vdev, ptdev_config->pbdf); vdev->ops = &pci_ops_vdev_pt; } else { vdev->ops = &pci_ops_vdev_hostbridge; diff --git a/hypervisor/include/dm/vpci.h b/hypervisor/include/dm/vpci.h index 036dcd596..2a7ebe61e 100644 --- a/hypervisor/include/dm/vpci.h +++ b/hypervisor/include/dm/vpci.h @@ -91,9 +91,6 @@ struct pci_vdev { /* The bus/device/function triple of the virtual PCI device. */ union pci_bdf vbdf; - /* The bus/device/function triple of the physical PCI device. */ - union pci_bdf pbdf; - struct pci_pdev *pdev; union pci_cfgdata cfgdata;