mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-20 16:28:10 +00:00
hv: vpci: refine vpci deinit
The existing code do separately for each VM when we deinit vpci of a VM. This is not necessary. This patch use the common handling for all VMs: we first deassign it from the (current) user, then give it back to its parent user. When we deassign the vdev from the (current) user, we would de-initialize the vMSI/VMSI-X remapping, so does the vMSI/vMSI-X data structure. Tracked-On: #4550 Signed-off-by: Li Fei1 <fei1.li@intel.com> Acked-by: Eddie Dong<eddie.dong@Intel.com>
This commit is contained in:
@@ -262,11 +262,12 @@ void init_vmsix(struct pci_vdev *vdev)
|
||||
* @pre vdev->vpci != NULL
|
||||
* @pre vdev->vpci->vm != NULL
|
||||
*/
|
||||
void deinit_vmsix(const struct pci_vdev *vdev)
|
||||
void deinit_vmsix(struct pci_vdev *vdev)
|
||||
{
|
||||
if (has_msix_cap(vdev)) {
|
||||
if (vdev->msix.table_count != 0U) {
|
||||
ptirq_remove_msix_remapping(vpci2vm(vdev->vpci), vdev->bdf.value, vdev->msix.table_count);
|
||||
(void)memset((void *)&vdev->msix, 0U, sizeof(struct pci_msix));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user