diff --git a/hypervisor/dm/vpci/vmsix_on_msi.c b/hypervisor/dm/vpci/vmsix_on_msi.c index 5fa14a813..ecafe4778 100644 --- a/hypervisor/dm/vpci/vmsix_on_msi.c +++ b/hypervisor/dm/vpci/vmsix_on_msi.c @@ -11,6 +11,7 @@ #include #include #include "vpci_priv.h" +#include #define PER_VECTOR_MASK_CAP 0x0100U @@ -113,6 +114,19 @@ void init_vmsix_on_msi(struct pci_vdev *vdev) /* fixed for memory, 32bit, non-prefetchable */ vdev->vbars[i].fixed = 0U; + if (vdev->vbars[i].base_gpa == 0UL) { + if (is_prelaunched_vm(vpci2vm(vdev->vpci))) { + /* + * we have predefined e820 table for pre-launched VM, + * 0x80000000UL is the base addr of 32bit PCI hole + */ + vdev->vbars[i].base_gpa = 0x80000000UL; + pr_acrnlog("%s: vm_id = %d, vbdf = %d:%d.%d", + __func__, vpci2vm(vdev->vpci)->vm_id, + vdev->bdf.bits.b, vdev->bdf.bits.d, vdev->bdf.bits.f); + } + } + /* 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.