diff --git a/hypervisor/dm/vpci/pci_pt.c b/hypervisor/dm/vpci/pci_pt.c index 324dad981..73966826c 100644 --- a/hypervisor/dm/vpci/pci_pt.c +++ b/hypervisor/dm/vpci/pci_pt.c @@ -418,6 +418,11 @@ void init_vdev_pt(struct pci_vdev *vdev, bool is_pf_vdev) } } } + + if (!is_sos_vm(vpci2vm(vdev->vpci)) && (has_sriov_cap(vdev))) { + vdev_pt_hide_sriov_cap(vdev); + } + } /* diff --git a/hypervisor/dm/vpci/vpci.c b/hypervisor/dm/vpci/vpci.c index 6b4e6ed69..0f0b00fa4 100644 --- a/hypervisor/dm/vpci/vpci.c +++ b/hypervisor/dm/vpci/vpci.c @@ -676,15 +676,10 @@ int32_t vpci_assign_pcidev(struct acrn_vm *tgt_vm, struct acrn_assign_pcidev *pc sos_vm = get_sos_vm(); spinlock_obtain(&sos_vm->vpci.lock); vdev_in_sos = pci_find_vdev(&sos_vm->vpci, bdf); - /* - * TODO We didn't support SR-IOV capability of PF in UOS for now, we should - * hide the SR-IOV capability if we pass through the PF to a UOS. - * - * For now, we don't support assignment of PF to a UOS. - */ if ((vdev_in_sos != NULL) && (vdev_in_sos->user == vdev_in_sos) && - (vdev_in_sos->pdev != NULL) && (!has_sriov_cap(vdev_in_sos)) && + (vdev_in_sos->pdev != NULL) && !is_host_bridge(vdev_in_sos->pdev) && !is_bridge(vdev_in_sos->pdev)) { + /* ToDo: Each PT device must support one type reset */ if (!vdev_in_sos->pdev->has_pm_reset && !vdev_in_sos->pdev->has_flr && !vdev_in_sos->pdev->has_af_flr) {