From 906c79eb4006deb33d1e1ac3e75f56b786787f8a Mon Sep 17 00:00:00 2001 From: Binbin Wu Date: Fri, 15 Mar 2019 12:03:26 +0800 Subject: [PATCH] hv: vpci: restore vbdf when pci dev un-assigned from uos When a pci device assined to UOS, the virtual bdf is allocated by device model. After the pci device un-assigned from UOS, it is back to SOS. The virtual bdf should be restored. The virtual bdf equals physical bdf for a pci device in SOS. Tracked-On: #2788 Signed-off-by: Binbin Wu Acked-by: Eddie Dong --- hypervisor/dm/vpci/sharing_mode.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hypervisor/dm/vpci/sharing_mode.c b/hypervisor/dm/vpci/sharing_mode.c index f04101a5d..f3cc4afaa 100644 --- a/hypervisor/dm/vpci/sharing_mode.c +++ b/hypervisor/dm/vpci/sharing_mode.c @@ -251,6 +251,8 @@ void vpci_reset_ptdev_intr_info(const struct acrn_vm *target_vm, uint16_t vbdf, if (vm != NULL) { vdev->vpci = &vm->vpci; + /* vbdf equals to pbdf in sos */ + vdev->vbdf.value = vdev->pdev->bdf.value; } } }