mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-23 09:47:44 +00:00
hv: release IOMMU irte when releasing ptirq remapping entries
IRTE is freed if ptirq entry is released from remove_msix_remapping() or remove_intx_remapping(). But if it's called from ptdev_release_all_entries(), e.g. SOS shutdown/reboot, IRTE is not freed. This patch adds a release_cb() callback function to do any architectural specific cleanup. In x86, it's used to release IRTE. On VM shutdown, vpci_cleanup() needs to remove MSI/MSI-X remapping on ptirq entries, thus it should be called before ptdev_release_all_entries(). Tracked-On: #2700 Signed-off-by: Sainath Grandhi <sainath.grandhi@intel.com> Signed-off-by: Zide Chen <zide.chen@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -198,6 +198,9 @@ void ptdev_release_all_entries(const struct acrn_vm *vm)
|
||||
entry = &ptirq_entries[idx];
|
||||
if ((entry->vm == vm) && is_entry_active(entry)) {
|
||||
spinlock_obtain(&ptdev_lock);
|
||||
if (entry->release_cb != NULL) {
|
||||
entry->release_cb(entry);
|
||||
}
|
||||
ptirq_deactivate_entry(entry);
|
||||
ptirq_release_entry(entry);
|
||||
spinlock_release(&ptdev_lock);
|
||||
|
Reference in New Issue
Block a user