From de589c25fcf41b2f4757957b0d78d5dcea784e41 Mon Sep 17 00:00:00 2001 From: "Li, Fei1" Date: Mon, 16 Sep 2019 20:06:18 +0800 Subject: [PATCH] hv: vpci: a minor fix about vpci_init_pt_dev In "commit 6ebc22" the vPCI device initialize sequence is wrong changed. This patch tries to revert it. Tracked-On: #3475 Signed-off-by: Li, Fei1 --- hypervisor/dm/vpci/vpci.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hypervisor/dm/vpci/vpci.c b/hypervisor/dm/vpci/vpci.c index 794e49f4b..0e8b2ecc4 100644 --- a/hypervisor/dm/vpci/vpci.c +++ b/hypervisor/dm/vpci/vpci.c @@ -328,12 +328,13 @@ static struct pci_vdev *find_vdev(const struct acrn_vpci *vpci, union pci_bdf bd static void vpci_init_pt_dev(struct pci_vdev *vdev) { /* - * init_vdev_pt() must be called before init_vmsix() because init_vmsix - * assigns BAR base hpa to MSI-X mmio_hpa which is initialized in init_vdev_pt(). + * Here init_vdev_pt() needs to be called after init_vmsix() for the following reason: + * init_vdev_pt() will indirectly call has_msix_cap(), which + * requires init_vmsix() to be called first. */ - init_vdev_pt(vdev); init_vmsi(vdev); init_vmsix(vdev); + init_vdev_pt(vdev); assign_vdev_pt_iommu_domain(vdev); }