hv: use pci_vdev_write_vbar instead of vdev_pt_write_vbar

When init_vmsix_on_msi is called during the initialization of a pt
device, the vmsix bar used for vmsix over msi is just created. No
mapping/unmapping is done and pci_vdev_write_vbar should be called
instead of vdev_pt_write_vbar at the time. Currently the Bar mapping
is delayed till OS sizing the Bar. Backup vbar base_gpa to mmio_gpa
is not required here becuase it will be done later when Bar mapping.

Tracked-On: #5316
Signed-off-by: Jian Jun Chen <jian.jun.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Jian Jun Chen 2020-10-29 08:45:39 +08:00 committed by wenlingz
parent a4cca45bc6
commit 182620535b

View File

@ -115,14 +115,11 @@ void init_vmsix_on_msi(struct pci_vdev *vdev)
/* About MSI-x bar GPA:
* - For Service VM: when first time init, it is programmed as 0, then OS will program
* the value later and the value is stored in vdev->vbars[MSI-X_BAR_ID].base_gpa.
* When the device is assigned to UOS and then assgined back to SOS, the stored base
* GPA will be used.
* the value later.
* - For Post-launched VM: The GPA is assigned by device model.
* - For Pre-launched VM: Not supported yet.
*/
vdev->msix.mmio_gpa = vdev->vbars[i].base_gpa;
vdev_pt_write_vbar(vdev, i, (uint32_t)(vdev->vbars[i].base_gpa & 0xFFFFFFFFUL));
pci_vdev_write_vbar(vdev, i, (uint32_t)vdev->vbars[i].base_gpa);
}
}
}