hv: vpci: minor refine about MSI/MSI-X de-initialization

About the MSI/MSI-X Capability, there're some fields of it would never been changed
once they had been initialized. So it's no need to reset them once the vdev instance
is still used. What need to reset are the fields which would been changed by guest
at runtime.

Tracked-On: #4550
Signed-off-by: Li Fei1 <fei1.li@intel.com>
This commit is contained in:
Li Fei1
2020-06-30 14:56:55 +08:00
committed by wenlingz
parent 3b120807c9
commit 41805eb2e8
3 changed files with 4 additions and 4 deletions

View File

@@ -134,11 +134,10 @@ void write_vmsi_cap_reg(struct pci_vdev *vdev, uint32_t offset, uint32_t bytes,
* @pre vdev != NULL
* @pre vdev->vpci != NULL
*/
void deinit_vmsi(struct pci_vdev *vdev)
void deinit_vmsi(const struct pci_vdev *vdev)
{
if (has_msi_cap(vdev)) {
ptirq_remove_msix_remapping(vpci2vm(vdev->vpci), vdev->pdev->bdf.value, 1U);
(void)memset((void *)&vdev->msi, 0U, sizeof(struct pci_msi));
}
}